Lunchbox
1.17.0
Multi-threaded C++ toolbox library for all application developers creating high-performance multi-threaded programs.
|
A convenience structure to hold data together with a lock for access. More...
#include <lockable.h>
Public Member Functions | |
Lockable () | |
Construct a new lockable data structure. More... | |
Lockable (const D &value) | |
Construct and initialize a new data structure. More... | |
template<class P1 > | |
Lockable (const P1 &p1) | |
Construct and initialize a new data structure. More... | |
D * | operator-> () |
Access the held data. More... | |
const D * | operator-> () const |
Access the held data. More... | |
D & | operator* () |
Access the held data. More... | |
const D & | operator* () const |
Access the held data. More... | |
bool | operator== (const D &rhs) const |
Lockable & | operator= (const D &rhs) |
Assign another value to the data. More... | |
Public Attributes | |
D | data |
L | lock |
A convenience structure to hold data together with a lock for access.
Locking the data still has to be done manually, e.g, using a ScopedMutex.
Definition at line 35 of file lockable.h.
|
inline |
|
inlineexplicit |
|
inline |
Construct and initialize a new data structure.
Definition at line 48 of file lockable.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 62 of file lockable.h.