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

Handle to an owned thread. More...

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

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.
 
Threadoperator= (Thread other)
 Assignment operator.
 
constexpr ThreadRef (const ThreadRef &other)
 Copy constructor.
 
constexpr ThreadRef (ThreadRef &&other)
 Move constructor.
 
- Public Member Functions inherited from SDL::ThreadRef
constexpr ThreadRef (const ThreadRef &other)
 Copy constructor.
 
constexpr ThreadRef (ThreadRef &&other)
 Move constructor.
 
constexpr ~ThreadRef ()=default
 Default constructor.
 
ThreadRefoperator= (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.
 
- Public Member Functions inherited from SDL::ThreadBase
 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
 
- Public Member Functions inherited from SDL::Resource< SDL_Thread * >
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
 
Resourceoperator= (const Resource &other)=delete
 
Resourceoperator= (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 Public Member Functions inherited from SDL::ThreadBase
static void SetCurrentPriority (ThreadPriority priority)
 Set the priority for the current thread.
 

Detailed Description

Category:
Resource
See also
ThreadBase
ThreadRef

The documentation for this struct was generated from the following file: