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

Reference for SharedObject. More...

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

Public Member Functions

 SharedObjectRef (SharedObjectRaw resource) noexcept
 Constructs from raw SharedObject. More...
 
constexpr SharedObjectRef (const SharedObject &resource) noexcept
 Constructs from SharedObject. More...
 
constexpr SharedObjectRef (SharedObject &&resource) noexcept
 Constructs from SharedObject. More...
 
constexpr SharedObjectRef (const SharedObjectRef &other) noexcept
 Copy constructor.
 
constexpr SharedObjectRef (SharedObjectRef &&other) noexcept
 Move constructor.
 
 ~SharedObjectRef ()
 Destructor.
 
constexpr SharedObjectRefoperator= (const SharedObjectRef &other) noexcept=default
 Assignment operator.
 
constexpr operator SharedObjectRaw () const noexcept
 Converts to SharedObjectRaw.
 
constexpr SharedObject (std::nullptr_t=nullptr) noexcept
 Default ctor.
 
constexpr SharedObject (const SharedObjectRaw resource) noexcept
 Constructs from SharedObjectRef. More...
 
constexpr SharedObject (const SharedObject &other) noexcept=default
 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 SharedObjectRef. More...
 
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.
 
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 SharedObject (const SharedObject &other) noexcept=default
 Copy constructor.
 
constexpr SharedObjectoperator= (const SharedObject &other) noexcept=default
 Assignment operator.
 

Detailed Description

This does not take ownership!

Constructor & Destructor Documentation

◆ SharedObjectRef() [1/3]

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

This does not takes ownership!

◆ SharedObjectRef() [2/3]

constexpr SDL::SharedObjectRef::SharedObjectRef ( const SharedObject resource)
inlineconstexprnoexcept
Parameters
resourcea SharedObject.

This does not takes ownership!

◆ SharedObjectRef() [3/3]

constexpr SDL::SharedObjectRef::SharedObjectRef ( SharedObject &&  resource)
inlineconstexprnoexcept
Parameters
resourcea SharedObject.

This will release the ownership from resource!

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: