SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SDL::SharedObjectRef Struct Reference

Semi-safe reference for SharedObject.

Inheritance diagram for SDL::SharedObjectRef:
Inheritance graph
[legend]
Collaboration diagram for SDL::SharedObjectRef:
Collaboration graph
[legend]

Public Member Functions

 SharedObjectRef (SharedObjectParam resource) noexcept
 Constructs from SharedObjectParam. More...
 
 SharedObjectRef (SharedObjectRaw resource) noexcept
 Constructs from SharedObjectParam. More...
 
 SharedObjectRef (const SharedObjectRef &other) noexcept
 Copy constructor.
 
 ~SharedObjectRef ()
 Destructor.
 
constexpr SharedObject (std::nullptr_t=nullptr) noexcept
 Default ctor.
 
constexpr SharedObject (const SharedObjectRaw resource) noexcept
 Constructs from SharedObjectParam. More...
 
constexpr SharedObject (const SharedObject &other)=delete
 Copy constructor.
 
constexpr SharedObject (SharedObject &&other) noexcept
 Move constructor.
 
constexpr SharedObject (const SharedObjectRef &other)=delete
 
constexpr SharedObject (SharedObjectRef &&other)=delete
 
 SharedObject (StringParam sofile)
 Dynamically load a shared object. More...
 
- Public Member Functions inherited from SDL::SharedObject
constexpr SharedObject (std::nullptr_t=nullptr) noexcept
 Default ctor.
 
constexpr SharedObject (const SharedObjectRaw resource) noexcept
 Constructs from SharedObjectParam. More...
 
constexpr SharedObject (const SharedObject &other)=delete
 Copy constructor.
 
constexpr SharedObject (SharedObject &&other) noexcept
 Move constructor.
 
constexpr SharedObject (const SharedObjectRef &other)=delete
 
constexpr SharedObject (SharedObjectRef &&other)=delete
 
 SharedObject (StringParam sofile)
 Dynamically load a shared object. More...
 
 ~SharedObject ()
 Destructor.
 
constexpr SharedObjectoperator= (SharedObject &&other) noexcept
 Assignment operator.
 
constexpr SharedObjectRaw get () const noexcept
 Retrieves underlying SharedObjectRaw.
 
constexpr SharedObjectRaw release () noexcept
 Retrieves underlying SharedObjectRaw and clear this.
 
constexpr auto operator<=> (const SharedObject &other) const noexcept=default
 Comparison.
 
constexpr operator bool () const noexcept
 Converts to bool.
 
constexpr operator SharedObjectParam () const noexcept
 Converts to SharedObjectParam.
 
void Unload ()
 Unload a shared object from memory. More...
 
FunctionPointer LoadFunction (StringParam name)
 Look up the address of the named function in a shared object. More...
 

Additional Inherited Members

- Protected Member Functions inherited from SDL::SharedObject
constexpr SharedObjectoperator= (const SharedObject &other) noexcept=default
 Assignment operator.
 

Constructor & Destructor Documentation

◆ SharedObjectRef() [1/2]

SDL::SharedObjectRef::SharedObjectRef ( SharedObjectParam  resource)
inlinenoexcept
Parameters
resourcea SharedObjectRaw or SharedObject.

This does not takes ownership!

◆ SharedObjectRef() [2/2]

SDL::SharedObjectRef::SharedObjectRef ( SharedObjectRaw  resource)
inlinenoexcept
Parameters
resourcea SharedObjectRaw or SharedObject.

This does not takes ownership!

Member Function Documentation

◆ SharedObject() [1/2]

constexpr SDL::SharedObject::SharedObject ( const SharedObjectRaw  resource)
inlineexplicitconstexprnoexcept
Parameters
resourcea SharedObjectRaw to be wrapped.

This assumes the ownership, call release() if you need to take back.

◆ SharedObject() [2/2]

SDL::SharedObject::SharedObject ( StringParam  sofile)
inline
Parameters
sofilea system-dependent name of the object file.
Postcondition
an opaque pointer to the object handle or nullptr on failure; call GetError() for more information.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
SharedObject.LoadFunction
SharedObject.Unload

The documentation for this struct was generated from the following file: