|
| template<class SomeType > |
| | Atomic (SomeType &&am) |
| | Creates the Atomic instance.
|
| |
|
| Atomic () |
| | Creates the Atomic instance.
|
| |
| template<class Functor > |
| auto | locked (Functor &&lambda) -> decltype(lambda(std::declval< Type & >())) |
| | Calls the lambda function using the unique lock.
|
| |
| template<class Functor > |
| auto | locked (Functor &&lambda) const -> decltype(lambda(std::declval< const Type & >())) const |
| | Calls the lambda using the lock.
|
| |
| Type | lockedCopy () const |
| | Gets a copy of the data using the lock.
|
| |
| Type | lockedMove () |
| | Gets a copy of the moved data using the unique lock.
|
| |
| template<class SomeType > |
| void | lockedAssign (SomeType &&am) |
| | Assigns the data using the unique lock.
|
| |
| void | lockedSwap (Type &other) |
| | Exchanges context with the Type object using the unique lock.
|
| |
| Type | lockedSwapWithDefault () |
| | Exchanges context with the Type object using the unique lock and moves data.
|
| |
| | operator bool () const |
| | Converts to bool if the wrapped type is bool convertible.
|
| |
template<class Type, typename MutexType = std::mutex, typename ReadLockType = std::lock_guard<MutexType>>
class olp::thread::Atomic< Type, MutexType, ReadLockType >
A simple atomic wrapper.
Depending on the provided MutexType, it can be multi-read/single-write or single-read/single-write.
- Template Parameters
-
| Type | The member type to which atomic access is required. |
| MutexType | Defines the lock type. |
| ReadLockType | Defines the locking strategy for the atomic read operation. |