template<typename T, typename LockType = Mutex>
class etcpal::StrictLockPtr< T, LockType >
An RAII handle holding a SynchronizedValue's lock and granting mutable access to the value.
Like ConstStrictLockPtr, but hands out mutable access. Normally obtained from SynchronizedValue. Move-only.
- Note
- StrictLockPtr implies the lock is held, but this fails to be true if moved.
- Template Parameters
-
| T | The type of the guarded value. |
| LockType | The type of lock guarding the value. |
|
| | StrictLockPtr (SynchronizedValue< T, LockType > &sync) |
| | Lock the given SynchronizedValue for mutable access. More...
|
| |
|
| StrictLockPtr (SynchronizedValue< T, LockType > &sync, AdoptLockTag) noexcept |
| | Adopt the given SynchronizedValue's lock, which the calling thread must already hold.
|
| |
| | StrictLockPtr (UniqueLockPtr< T, LockType > &&other) |
| | Take over the lock held by other, which is left empty. More...
|
| |
|
T & | operator* () noexcept |
| | Get a mutable reference to the guarded value. Undefined behavior if this handle has been moved from.
|
| |
|
T * | operator-> () noexcept |
| | Access a member of the guarded value. Undefined behavior if this handle has been moved from.
|
| |
| | ConstStrictLockPtr (const SynchronizedValue< T, Mutex > &sync) |
| | Lock the given SynchronizedValue for read-only access. More...
|
| |
|
| ConstStrictLockPtr (const SynchronizedValue< T, Mutex > &sync, AdoptLockTag) noexcept |
| | Adopt the given SynchronizedValue's lock, which the calling thread must already hold.
|
| |
| | ConstStrictLockPtr (ConstUniqueLockPtr< T, Mutex > &&other) |
| | Take over the lock held by other, which is left empty. More...
|
| |
|
| ConstStrictLockPtr (const ConstStrictLockPtr &)=delete |
| |
|
| ConstStrictLockPtr (ConstStrictLockPtr &&other) noexcept |
| | Move ownership of the held lock from another handle, which is left empty.
|
| |
|
ConstStrictLockPtr & | operator= (const ConstStrictLockPtr &)=delete |
| |
|
ConstStrictLockPtr & | operator= (ConstStrictLockPtr &&)=delete |
| |
|
| ~ConstStrictLockPtr () noexcept |
| | Release the lock.
|
| |
|
const T & | operator* () const noexcept |
| | Get a reference to the guarded value. Undefined behavior if this handle has been moved from.
|
| |
|
const T * | operator-> () const noexcept |
| | Access a member of the guarded value. Undefined behavior if this handle has been moved from.
|
| |