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

Wrap the lock state for Properties.

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

Public Member Functions

constexpr PropertiesLock ()=default
 Creates an empty lock.
 
constexpr PropertiesLock (PropertiesLock &&other)
 Move constructor.
 
 PropertiesLock (PropertiesRef props)
 Lock a group of properties.
 
 ~PropertiesLock ()
 Destructor.
 
void Unlock ()
 Unlock a group of properties.
 
void reset ()
 Same as Unlock(), just for uniformity.
 
- Public Member Functions inherited from SDL::LockBase< PropertiesRef >
constexpr LockBase ()=default
 Default ctor.
 
 LockBase (const LockBase &other)=delete
 
 LockBase (LockBase &&other)
 Move ctor.
 
constexpr ~LockBase ()
 Dtor.
 
LockBaseoperator= (LockBase other)
 Move assignment.
 
- Public Member Functions inherited from SDL::ResourceOwnerBase< RESOURCE, DELETER >
RESOURCE release ()
 Returns reference and reset this.
 
- Public Member Functions inherited from SDL::ResourcePtrBase< RESOURCE >
constexpr operator bool () const
 Check if not null.
 
constexpr bool operator== (const ResourcePtrBase &other) const
 Comparison.
 
constexpr bool operator== (std::nullptr_t) const
 Comparison.
 
constexpr bool operator== (std::nullopt_t) const
 Comparison.
 
constexpr reference operator* () const
 Gets reference.
 
constexpr const referenceoperator-> () const
 Gets addressable reference.
 
constexpr referenceoperator-> ()
 Gets addressable reference.
 
reference get () const
 Get reference.
 

Additional Inherited Members

- Public Types inherited from SDL::ResourceOwnerBase< RESOURCE, DELETER >
using deleter = DELETER
 The deleter type.
 
- Public Types inherited from SDL::ResourcePtrBase< RESOURCE >
using reference = RESOURCE
 The reference resource type.
 
using value_type = typename reference::value_type
 The raw resource type.
 
- Protected Member Functions inherited from SDL::LockBase< PropertiesRef >
constexpr LockBase (PropertiesRef &&resource)
 Constructs initializing member.
 
- Protected Member Functions inherited from SDL::ResourceOwnerBase< RESOURCE, DELETER >
constexpr ResourceOwnerBase (base::value_type value={}, DELETER deleter={})
 Constructs from raw type.
 
void free ()
 Frees resource.
 
- Protected Member Functions inherited from SDL::ResourcePtrBase< RESOURCE >
constexpr ResourcePtrBase (value_type value={})
 Constructs from raw type.
 
referenceget ()
 Get reference.
 

Constructor & Destructor Documentation

◆ PropertiesLock()

SDL::PropertiesLock::PropertiesLock ( PropertiesRef  props)
inline

Obtain a multi-threaded lock for these properties. Other threads will wait while trying to lock these properties until they are unlocked. Properties must be unlocked before they are destroyed.

The lock is automatically taken when setting individual properties, this function is only needed when you want to set several properties atomically or want to guarantee that properties being queried aren't freed in another thread.

Parameters
propsthe properties to lock.
Exceptions
Erroron failure.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
PropertiesLock.Unlock

◆ ~PropertiesLock()

SDL::PropertiesLock::~PropertiesLock ( )
inline
See also
Unlock()

Member Function Documentation

◆ Unlock()

void SDL::PropertiesLock::Unlock ( )
inline
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
PropertiesRef.Lock

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