SDL3pp
A slim C++ wrapper for SDL3
|
Handle to an owned semaphore. More...
Public Member Functions | |
constexpr | Semaphore (SDL_Semaphore *resource={}) |
Constructs from the underlying resource. | |
constexpr | Semaphore (const Semaphore &other)=delete |
constexpr | Semaphore (Semaphore &&other)=default |
Move constructor. | |
~Semaphore () | |
Frees up resource when object goes out of scope. | |
Semaphore & | operator= (Semaphore other) |
Assignment operator. | |
constexpr | SemaphoreRef (const SemaphoreRef &other) |
Copy constructor. | |
constexpr | SemaphoreRef (SemaphoreRef &&other) |
Move constructor. | |
![]() | |
constexpr | SemaphoreRef (const SemaphoreRef &other) |
Copy constructor. | |
constexpr | SemaphoreRef (SemaphoreRef &&other) |
Move constructor. | |
constexpr | ~SemaphoreRef ()=default |
Default constructor. | |
SemaphoreRef & | operator= (SemaphoreRef other) |
Assignment operator. | |
void | reset (SDL_Semaphore *newResource={}) |
Destroy a semaphore. | |
SemaphoreBase (Uint32 initial_value) | |
Create a semaphore. | |
![]() | |
SemaphoreBase (Uint32 initial_value) | |
Create a semaphore. | |
void | Wait () |
Wait until a semaphore has a positive value and then decrements it. | |
bool | TryWait () |
See if a semaphore has a positive value and decrement it if it does. | |
bool | WaitTimeout (std::chrono::milliseconds timeout) |
Wait until a semaphore has a positive value and then decrements it. | |
void | Signal () |
Atomically increment a semaphore's value and wake waiting threads. | |
Uint32 | GetValue () const |
Get the current value of a semaphore. | |
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_Semaphore * 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_Semaphore * | get () const |
Return contained resource;. | |
constexpr SDL_Semaphore * | release (SDL_Semaphore * newResource={}) |
Return contained resource and empties or replace value. | |
constexpr const SDL_Semaphore * | operator-> () const |
Access to fields. | |
constexpr SDL_Semaphore * | operator-> () |
Access to fields. | |