|
perfc 0.11.0
|
Simple type that provide synchronized access by holding a lock to T container. More...
#include <register.hpp>
Simple type that provide synchronized access by holding a lock to T container.
Accessing the locked object is peformed using pointer semantics.
Definition at line 57 of file register.hpp.
Public Types | |
| using | PointerType = std::add_pointer_t<T> |
| using | ReferenceType = std::add_lvalue_reference_t<T> |
Public Member Functions | |
| Locked (ReferenceType t, Mutex &mutex) | |
| Construct by providing reference to object requiring synchronized access and the mutex protecting it. | |
| Locked (Locked &&other) noexcept | |
| Move constructs by taking owneship of internal state of other. | |
| Locked & | operator= (Locked &&other) noexcept |
| Move constructs by taking owneship of internal state of other. | |
| PointerType | Get () const noexcept |
| ReferenceType | operator* () const noexcept |
| PointerType | operator-> () const noexcept |
| operator bool () const noexcept | |
| void | Unlock () noexcept |
| Unlocks lock. | |
| using perfc::Locked< T, Mutex >::PointerType = std::add_pointer_t<T> |
Definition at line 59 of file register.hpp.
| using perfc::Locked< T, Mutex >::ReferenceType = std::add_lvalue_reference_t<T> |
Definition at line 60 of file register.hpp.
|
inline |
Construct by providing reference to object requiring synchronized access and the mutex protecting it.
| t | Object to obtain exclusive access to. |
| mutex | Mutex protecting t. |
| Exception | originating from Mutex::lock() (typically std::system_error) |
Definition at line 70 of file register.hpp.
|
inlinenoexcept |
Move constructs by taking owneship of internal state of other.
| other | Object to move from. |
Definition at line 77 of file register.hpp.
|
inlinenoexcept |
Definition at line 98 of file register.hpp.
|
inlinenoexcept |
Definition at line 117 of file register.hpp.
|
inlinenoexcept |
Definition at line 104 of file register.hpp.
|
inlinenoexcept |
Definition at line 110 of file register.hpp.
|
inlinenoexcept |
Move constructs by taking owneship of internal state of other.
| other | Object to move from. |
Definition at line 87 of file register.hpp.
|
inlinenoexcept |
Unlocks lock.
Get() == nullptr Definition at line 128 of file register.hpp.