Lunchbox
1.4.0
|
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. | |
Lockable (const D &value) | |
Construct and initialize a new data structure. | |
template<class P1 > | |
Lockable (const P1 &p1) | |
Construct and initialize a new data structure. | |
D * | operator-> () |
Access the held data. | |
const D * | operator-> () const |
Access the held data. | |
D & | operator* () |
Access the held data. | |
const D & | operator* () const |
Access the held data. | |
bool | operator== (const D &rhs) const |
Lockable & | operator= (const D &rhs) |
Assign another value to the data. | |
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 32 of file lockable.h.
lunchbox::Lockable< D, L >::Lockable | ( | ) | [inline, explicit] |
lunchbox::Lockable< D, L >::Lockable | ( | const D & | value | ) | [inline, explicit] |
Construct and initialize a new data structure.
Definition at line 39 of file lockable.h.
lunchbox::Lockable< D, L >::Lockable | ( | const P1 & | p1 | ) | [inline] |
Construct and initialize a new data structure.
Definition at line 42 of file lockable.h.
D& lunchbox::Lockable< D, L >::operator* | ( | ) | [inline] |
const D& lunchbox::Lockable< D, L >::operator* | ( | ) | const [inline] |
D* lunchbox::Lockable< D, L >::operator-> | ( | ) | [inline] |
const D* lunchbox::Lockable< D, L >::operator-> | ( | ) | const [inline] |
Lockable& lunchbox::Lockable< D, L >::operator= | ( | const D & | rhs | ) | [inline] |
bool lunchbox::Lockable< D, L >::operator== | ( | const D & | rhs | ) | const [inline] |
Definition at line 57 of file lockable.h.