SDL3pp
A slim C++ wrapper for SDL3
|
Handle to an owned thread. More...
Public Member Functions | |
constexpr | Thread (SDL_Thread *resource={}) |
Constructs from the underlying resource. | |
constexpr | Thread (const Thread &other)=delete |
constexpr | Thread (Thread &&other)=default |
Move constructor. | |
~Thread () | |
Frees up resource when object goes out of scope. | |
Thread & | operator= (Thread other) |
Assignment operator. | |
constexpr | ThreadRef (const ThreadRef &other) |
Copy constructor. | |
constexpr | ThreadRef (ThreadRef &&other) |
Move constructor. | |
![]() | |
constexpr | ThreadRef (const ThreadRef &other) |
Copy constructor. | |
constexpr | ThreadRef (ThreadRef &&other) |
Move constructor. | |
constexpr | ~ThreadRef ()=default |
Default constructor. | |
ThreadRef & | operator= (ThreadRef other) |
Assignment operator. | |
void | reset (SDL_Thread *newResource={}) |
Let a thread clean up on exit without intervention. | |
void | Detach () |
Let a thread clean up on exit without intervention. | |
ThreadBase (ThreadCB fn, StringParam name) | |
Create a new thread with a default stack size. | |
ThreadBase (ThreadFunction fn, StringParam name, void *data) | |
Create a new thread with a default stack size. | |
ThreadBase (PropertiesBase &props) | |
Create a new thread with with the specified properties. | |
![]() | |
ThreadBase (ThreadCB fn, StringParam name) | |
Create a new thread with a default stack size. | |
ThreadBase (ThreadFunction fn, StringParam name, void *data) | |
Create a new thread with a default stack size. | |
ThreadBase (PropertiesBase &props) | |
Create a new thread with with the specified properties. | |
const char * | GetName () const |
Get the thread name as it was specified in ThreadBase.ThreadBase(). | |
ThreadID | GetID () const |
Get the thread identifier for the specified thread. | |
void | Wait (int *status) |
Wait for a thread to finish. | |
ThreadState | GetState () const |
Get the current state of a thread. | |
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_Thread * 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_Thread * | get () const |
Return contained resource;. | |
constexpr SDL_Thread * | release (SDL_Thread * newResource={}) |
Return contained resource and empties or replace value. | |
constexpr const SDL_Thread * | operator-> () const |
Access to fields. | |
constexpr SDL_Thread * | operator-> () |
Access to fields. | |
Additional Inherited Members | |
![]() | |
static void | SetCurrentPriority (ThreadPriority priority) |
Set the priority for the current thread. | |