39 template <
class Type,
typename MutexType = std::mutex,
40 typename ReadLockType = std::lock_guard<MutexType> >
59 template <
class SomeType>
60 explicit Atomic(SomeType&& am) :
m(std::forward<SomeType>(am)) {}
75 template <
class Functor>
76 auto locked(Functor&& lambda) -> decltype(lambda(std::declval<Type&>())) {
91 template <
class Functor>
93 -> decltype(lambda(std::declval<const Type&>()))
const {
124 template <
class SomeType>
127 m = std::forward<SomeType>(am);
158 explicit operator bool()
const {
160 return static_cast<bool>(
m);
A simple atomic wrapper.
Definition: Atomic.h:41
Type lockedCopy() const
Gets a copy of the data using the lock.
Definition: Atomic.h:103
auto locked(Functor &&lambda) -> decltype(lambda(std::declval< Type & >()))
Calls the lambda function using the unique lock.
Definition: Atomic.h:76
auto locked(Functor &&lambda) const -> decltype(lambda(std::declval< const Type & >())) const
Calls the lambda using the lock.
Definition: Atomic.h:92
Type value_type
Alias for the type.
Definition: Atomic.h:46
Type m
The member type to which atomic access is required.
Definition: Atomic.h:172
std::lock_guard< MutexType > WriteLockType
Alias for the atomic write mutex lock.
Definition: Atomic.h:51
Atomic(SomeType &&am)
Creates the Atomic instance.
Definition: Atomic.h:60
MutexType m_mutex
Defines the lock type.
Definition: Atomic.h:167
Atomic()
Creates the Atomic instance.
Definition: Atomic.h:65
void lockedSwap(Type &other)
Exchanges context with the Type object using the unique lock.
Definition: Atomic.h:135
Type lockedMove()
Gets a copy of the moved data using the unique lock.
Definition: Atomic.h:113
void lockedAssign(SomeType &&am)
Assigns the data using the unique lock.
Definition: Atomic.h:125
Type lockedSwapWithDefault()
Exchanges context with the Type object using the unique lock and moves data.
Definition: Atomic.h:146
Rules all the other namespaces.
Definition: AppleSignInProperties.h:24