Support Class Library
A set of tools providing classes and utility
|
A wrapper class that protects a value with a lock. More...
#include "Mutexed.h"
Public Types | |
using | lock_type = Lock |
using | guard_type = Guard< lock_type > |
using | value_type = T |
Public Member Functions | |
template<class... Args> | |
Mutexed (Args &&... args) | |
Mutexed (Mutexed &&) noexcept=default | |
Mutexed & | operator= (Mutexed &&) noexcept=default |
Mutexed (const Mutexed &)=delete | |
Mutexed & | operator= (const Mutexed &)=delete |
template<class F > | |
Mutexed & | transaction (F &&f) |
Protected Attributes | |
value_type | value |
std::unique_lock< lock_type > | lock {lock_type{}, std::defer_lock} |
A wrapper class that protects a value with a lock.
T | being the type of value to guard |
Lock | being the lock type |
Guard | being the type of guard to use on the lock |
using scl::async::Mutexed< T, Lock, Guard >::guard_type = Guard<lock_type> |
using scl::async::Mutexed< T, Lock, Guard >::lock_type = Lock |
using scl::async::Mutexed< T, Lock, Guard >::value_type = T |
|
inlineexplicit |
|
defaultnoexcept |
|
delete |
|
defaultnoexcept |
|
delete |
|
inline |
|
mutableprotected |
|
protected |