Wrap the lock state for Properties.
|
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.
|
|
constexpr | LockBase ()=default |
| Default ctor.
|
|
| LockBase (const LockBase &other)=delete |
|
| LockBase (LockBase &&other) |
| Move ctor.
|
|
constexpr | ~LockBase () |
| Dtor.
|
|
LockBase & | operator= (LockBase other) |
| Move assignment.
|
|
RESOURCE | release () |
| Returns reference and reset this.
|
|
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 reference * | operator-> () const |
| Gets addressable reference.
|
|
constexpr reference * | operator-> () |
| Gets addressable reference.
|
|
reference | get () const |
| Get reference.
|
|
|
using | deleter = DELETER |
| The deleter type.
|
|
using | reference = RESOURCE |
| The reference resource type.
|
|
using | value_type = typename reference::value_type |
| The raw resource type.
|
|
constexpr | LockBase (PropertiesRef &&resource) |
| Constructs initializing member.
|
|
constexpr | ResourceOwnerBase (base::value_type value={}, DELETER deleter={}) |
| Constructs from raw type.
|
|
void | free () |
| Frees resource.
|
|
constexpr | ResourcePtrBase (value_type value={}) |
| Constructs from raw type.
|
|
reference & | get () |
| Get reference.
|
|
◆ PropertiesLock()
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
-
props | the properties to lock. |
- Exceptions
-
- 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 |
◆ 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: