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

Reference for Condition. More...

Inheritance diagram for SDL::ConditionRef:
Inheritance graph
[legend]
Collaboration diagram for SDL::ConditionRef:
Collaboration graph
[legend]

Public Member Functions

constexpr ConditionRef (ConditionRaw resource) noexcept
 Constructs from raw Condition. More...
 
constexpr ConditionRef (const Condition &resource) noexcept
 Constructs from Condition. More...
 
constexpr ConditionRef (Condition &&resource) noexcept
 Constructs from Condition. More...
 
constexpr ConditionRef (const ConditionRef &other) noexcept
 Copy constructor.
 
constexpr ConditionRef (ConditionRef &&other) noexcept
 Move constructor.
 
 ~ConditionRef ()
 Destructor.
 
ConditionRefoperator= (const ConditionRef &other) noexcept
 Assignment operator.
 
constexpr operator ConditionRaw () const noexcept
 Converts to ConditionRaw.
 
constexpr Condition (std::nullptr_t) noexcept
 Default ctor.
 
constexpr Condition (ConditionRaw resource) noexcept
 Constructs from raw Condition. More...
 
constexpr Condition (const Condition &other) noexcept=delete
 Copy constructor.
 
constexpr Condition (Condition &&other) noexcept
 Move constructor.
 
constexpr Condition (const ConditionRef &other)=delete
 
constexpr Condition (ConditionRef &&other)=delete
 
 Condition ()
 Create a condition variable. More...
 
- Public Member Functions inherited from SDL::Condition
constexpr Condition (std::nullptr_t) noexcept
 Default ctor.
 
constexpr Condition (ConditionRaw resource) noexcept
 Constructs from raw Condition. More...
 
constexpr Condition (const Condition &other) noexcept=delete
 Copy constructor.
 
constexpr Condition (Condition &&other) noexcept
 Move constructor.
 
constexpr Condition (const ConditionRef &other)=delete
 
constexpr Condition (ConditionRef &&other)=delete
 
 Condition ()
 Create a condition variable. More...
 
 ~Condition ()
 Destructor.
 
constexpr Conditionoperator= (Condition &&other) noexcept
 Assignment operator.
 
Conditionoperator= (const Condition &other)=delete
 Assignment operator.
 
constexpr ConditionRaw get () const noexcept
 Retrieves underlying ConditionRaw.
 
constexpr ConditionRaw release () noexcept
 Retrieves underlying ConditionRaw and clear this.
 
constexpr auto operator<=> (const Condition &other) const noexcept=default
 Comparison.
 
constexpr operator bool () const noexcept
 Converts to bool.
 
void Destroy ()
 Destroy a condition variable. More...
 
void Signal ()
 Restart one of the threads that are waiting on the condition variable. More...
 
void Broadcast ()
 Restart all threads that are waiting on the condition variable. More...
 
void Wait (MutexRef mutex)
 Wait until a condition variable is signaled. More...
 
bool WaitTimeout (MutexRef mutex, std::chrono::milliseconds timeout)
 Wait until a condition variable is signaled or a certain time has passed. More...
 

Detailed Description

This does not take ownership!

Constructor & Destructor Documentation

◆ ConditionRef() [1/3]

constexpr SDL::ConditionRef::ConditionRef ( ConditionRaw  resource)
inlineconstexprnoexcept
Parameters
resourcea ConditionRaw.

This does not takes ownership!

◆ ConditionRef() [2/3]

constexpr SDL::ConditionRef::ConditionRef ( const Condition resource)
inlineconstexprnoexcept
Parameters
resourcea Condition.

This does not takes ownership!

◆ ConditionRef() [3/3]

constexpr SDL::ConditionRef::ConditionRef ( Condition &&  resource)
inlineconstexprnoexcept
Parameters
resourcea Condition.

This will release the ownership from resource!

Member Function Documentation

◆ Condition() [1/2]

SDL::Condition::Condition ( )
inline
Postcondition
a new condition variable or nullptr on failure; call GetError() for more information.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Condition.Broadcast
Condition.Signal
Condition.Wait
Condition.WaitTimeout
Condition.Destroy

◆ Condition() [2/2]

constexpr SDL::Condition::Condition ( ConditionRaw  resource)
inlineexplicitconstexprnoexcept
Parameters
resourcea ConditionRaw to be wrapped.

This assumes the ownership, call release() if you need to take back.


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