1#ifndef SDL3PP_LOADSO_H_
2#define SDL3PP_LOADSO_H_
4#include <SDL3/SDL_loadso.h>
5#include "SDL3pp_stdinc.h"
70 constexpr explicit operator bool()
const {
return !!
value; }
106 : m_resource(resource)
138 : m_resource(SDL_LoadObject(sofile))
148 std::swap(m_resource, other.m_resource);
159 m_resource =
nullptr;
167 constexpr bool operator==(std::nullptr_t _)
const {
return !m_resource; }
170 constexpr explicit operator bool()
const {
return !!m_resource; }
292 return SDL_LoadFunction(handle, name);
An opaque datatype that represents a loaded shared object.
Definition: SDL3pp_loadso.h:91
constexpr SharedObject()=default
Default ctor.
SharedObject(StringParam sofile)
Dynamically load a shared object.
Definition: SDL3pp_loadso.h:137
SharedObject & operator=(SharedObject other)
Assignment operator.
Definition: SDL3pp_loadso.h:146
constexpr auto operator<=>(const SharedObject &other) const =default
Comparison.
constexpr SharedObject(const SharedObject &other)=delete
Copy constructor.
constexpr SharedObject(SharedObject &&other)
Move constructor.
Definition: SDL3pp_loadso.h:114
~SharedObject()
Destructor.
Definition: SDL3pp_loadso.h:143
constexpr bool operator==(std::nullptr_t _) const
Comparison.
Definition: SDL3pp_loadso.h:167
constexpr SharedObjectRaw release()
Retrieves underlying SharedObjectRaw and clear this.
Definition: SDL3pp_loadso.h:156
constexpr SharedObject(const SharedObjectRaw resource)
Constructs from SharedObjectParam.
Definition: SDL3pp_loadso.h:105
constexpr SharedObjectRaw get() const
Retrieves underlying SharedObjectRaw.
Definition: SDL3pp_loadso.h:153
Helpers to use C++ strings parameters.
Definition: SDL3pp_strings.h:43
FunctionPointer LoadFunction(StringParam name)
Look up the address of the named function in a shared object.
Definition: SDL3pp_loadso.h:295
SharedObject LoadObject(StringParam sofile)
Dynamically load a shared object.
Definition: SDL3pp_loadso.h:258
void UnloadObject(SharedObjectRaw handle)
Unload a shared object from memory.
Definition: SDL3pp_loadso.h:315
void Unload()
Unload a shared object from memory.
Definition: SDL3pp_loadso.h:317
FunctionPointer LoadFunction(SharedObjectParam handle, StringParam name)
Look up the address of the named function in a shared object.
Definition: SDL3pp_loadso.h:290
SDL_SharedObject * SharedObjectRaw
Alias to raw representation for SharedObject.
Definition: SDL3pp_loadso.h:47
SDL_FunctionPointer FunctionPointer
A generic function pointer.
Definition: SDL3pp_stdinc.h:6206
Main include header for the SDL3pp library.
Safely wrap SharedObject for non owning parameters.
Definition: SDL3pp_loadso.h:54
SharedObjectRaw value
parameter's SharedObjectRaw
Definition: SDL3pp_loadso.h:55
constexpr SharedObjectParam(SharedObjectRaw value)
Constructs from SharedObjectRaw.
Definition: SDL3pp_loadso.h:58
constexpr auto operator<=>(const SharedObjectParam &other) const =default
Comparison.
constexpr SharedObjectParam(std::nullptr_t _=nullptr)
Constructs null/invalid.
Definition: SDL3pp_loadso.h:64
Semi-safe reference for SharedObject.
Definition: SDL3pp_loadso.h:221
~SharedObjectRef()
Destructor.
Definition: SDL3pp_loadso.h:241
SharedObjectRef(const SharedObjectRef &other)
Copy constructor.
Definition: SDL3pp_loadso.h:235
SharedObjectRef(SharedObjectParam resource)
Constructs from SharedObjectParam.
Definition: SDL3pp_loadso.h:229