CppUtils::Thread::UniqueLocker<class T>
CLASSMonitor Object wrapper encapsulating a resource with a mutex.
Description
Section titled “Description”Ensures that all access to the underlying resource must pass through an Accessor RAII object that holds the mutex lock, guaranteeing at compile time that access to the protected data is synchronized.
| Template parameter | Description |
|---|---|
T | The type of the protected resource. |
Public methods & functions
Section titled “Public methods & functions”Constructs the protected resource in place.
| Parameter | Description |
|---|---|
args | Arguments forwarded to the resource constructor. |
Move constructor. Acquires lock on the source locker before moving its value.
auto UniqueLocker::operator=(UniqueLocker&& other) noexcept(std::is_nothrow_move_assignable_v<T>) -> UniqueLocker&;Move assignment. Acquires scoped lock on both mutexes before moving the value.
Acquires exclusive read/write access to the resource.
Returns: Accessor object managing the lock and providing access.
Acquires exclusive read-only access to the resource from an lvalue reference.
Returns: Const Accessor object managing the lock.
Acquires exclusive read-only access to the resource from an rvalue reference.
Returns: Const Accessor object managing the lock.