|
| SharedObjectBase (StringParam sofile) |
| Dynamically load a shared object.
|
|
FunctionPointer | LoadFunction (StringParam name) |
| Look up the address of the named function in a shared object.
|
|
constexpr | Resource (T resource={}) |
| Constructs the underlying resource.
|
|
constexpr | Resource (std::nullptr_t) |
| Equivalent to default ctor.
|
|
constexpr | Resource (std::nullopt_t) |
| Equivalent to default ctor.
|
|
| Resource (const Resource &other)=delete |
|
| Resource (Resource &&other)=delete |
|
constexpr | Resource (SDL_SharedObject * resource={}) |
| Constructs the underlying resource.
|
|
constexpr | Resource (std::nullptr_t) |
| Equivalent to default ctor.
|
|
constexpr | Resource (std::nullopt_t) |
| Equivalent to default ctor.
|
|
| Resource (const Resource &other)=delete |
|
| Resource (Resource &&other)=delete |
|
Resource & | operator= (const Resource &other)=delete |
|
Resource & | operator= (Resource &&other)=delete |
|
constexpr | operator bool () const |
| True if contains a valid resource.
|
|
constexpr bool | operator== (const Resource &other) const=default |
| Comparison.
|
|
constexpr bool | operator== (std::nullopt_t) const |
| Comparison.
|
|
constexpr bool | operator== (std::nullptr_t) const |
| Comparison.
|
|
constexpr SDL_SharedObject * | get () const |
| Return contained resource;.
|
|
constexpr SDL_SharedObject * | release (SDL_SharedObject * newResource={}) |
| Return contained resource and empties or replace value.
|
|
constexpr const SDL_SharedObject * | operator-> () const |
| Access to fields.
|
|
constexpr SDL_SharedObject * | operator-> () |
| Access to fields.
|
|
This function pointer is no longer valid after calling SharedObjectRef.Unload().
This function can only look up C function names. Other languages may have name mangling and intrinsic language support that varies from compiler to compiler.
Make sure you declare your function pointers with the same calling convention as the actual library function. Your code will crash mysteriously if you do not do this.
If the requested function doesn't exist, nullptr is returned.
- Parameters
-
name | the name of the function to look up. |
- Returns
- a pointer to the function 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
- SharedObjectBase.SharedObjectBase