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

An opaque datatype that represents a loaded shared object. More...

Inheritance diagram for SDL::SharedObject:
Inheritance graph
[legend]

Public Member Functions

constexpr SharedObject ()=default
 Default ctor.
 
constexpr SharedObject (const SharedObjectRaw resource)
 Constructs from SharedObjectParam. More...
 
constexpr SharedObject (const SharedObject &other)=delete
 Copy constructor.
 
constexpr SharedObject (SharedObject &&other)
 Move constructor.
 
constexpr SharedObject (const SharedObjectRef &other)=delete
 
constexpr SharedObject (SharedObjectRef &&other)=delete
 
 SharedObject (StringParam sofile)
 Dynamically load a shared object. More...
 
 ~SharedObject ()
 Destructor.
 
SharedObjectoperator= (SharedObject other)
 Assignment operator.
 
constexpr SharedObjectRaw get () const
 Retrieves underlying SharedObjectRaw.
 
constexpr SharedObjectRaw release ()
 Retrieves underlying SharedObjectRaw and clear this.
 
constexpr auto operator<=> (const SharedObject &other) const =default
 Comparison.
 
constexpr bool operator== (std::nullptr_t _) const
 Comparison.
 
constexpr operator bool () const
 Converts to bool.
 
constexpr operator SharedObjectParam () const
 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...
 

Detailed Description

Since
This datatype is available since SDL 3.2.0.
See also
SharedObject.SharedObject
SharedObject.LoadFunction
SharedObject.Unload
Category:
Resource

Constructor & Destructor Documentation

◆ SharedObject() [1/2]

constexpr SDL::SharedObject::SharedObject ( const SharedObjectRaw  resource)
inlineexplicitconstexpr
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 class was generated from the following file: