1#ifndef SDL3PP_LOADSO_H_
2#define SDL3PP_LOADSO_H_
4#include <SDL3/SDL_loadso.h>
5#include "SDL3pp_stdinc.h"
45struct SharedObjectRef;
114 return SDL_LoadFunction(
get(), name);
131 static void reset(SDL_SharedObject* resource) { SDL_UnloadObject(resource); }
RESOURCE release()
Returns reference and reset this.
Definition SDL3pp_resource.h:178
Implement shared ownership for a resource.
Definition SDL3pp_resource.h:283
Implement unique ownership for a resource.
Definition SDL3pp_resource.h:226
constexpr ResourceUnique(std::nullptr_t=nullptr)
Default constructor.
Definition SDL3pp_resource.h:231
void reset()
Resets the value, destroying the resource if not nullptr.
Definition SDL3pp_resource.h:265
A dumb pointer to resource.
Definition SDL3pp_resource.h:197
constexpr ResourceUnsafe()=default
Default constructor.
Implement weak ownership for a resource.
Definition SDL3pp_resource.h:328
A SDL managed resource.
Definition SDL3pp_resource.h:29
constexpr Resource(T resource={})
Constructs from the underlying resource.
Definition SDL3pp_resource.h:37
constexpr SDL_SharedObject * get() const
Return contained resource;.
Definition SDL3pp_resource.h:76
Helpers to use C++ strings parameters.
Definition SDL3pp_strings.h:43
SharedObjectShared share()
Move this sharedObject into a SharedObjectShared.
Definition SDL3pp_loadso.h:186
ResourceShared< SharedObject > SharedObjectShared
Handle to a shared sharedObject.
Definition SDL3pp_loadso.h:58
SDL_FunctionPointer FunctionPointer
A generic function pointer.
Definition SDL3pp_stdinc.h:5467
the main namespace where all SDL3pp public functions and types live
Definition SDL3pp_assert.h:7
An opaque datatype that represents a loaded shared object.
Definition SDL3pp_loadso.h:83
static void reset(SDL_SharedObject *resource)
Unload a shared object from memory.
Definition SDL3pp_loadso.h:131
FunctionPointer LoadFunction(StringParam name)
Look up the address of the named function in a shared object.
Definition SDL3pp_loadso.h:112
Unsafe Handle to sharedObject.
Definition SDL3pp_loadso.h:201
constexpr SharedObjectUnsafe(SharedObject &&other)
Constructs SharedObjectUnsafe from SharedObject.
Definition SDL3pp_loadso.h:207
Handle to an owned sharedObject.
Definition SDL3pp_loadso.h:142
void Unload()
Unload a shared object from memory.
Definition SDL3pp_loadso.h:177
static SharedObject Load(StringParam sofile)
Dynamically load a shared object.
Definition SDL3pp_loadso.h:159