Lunchbox  1.6.0
Public Member Functions | Public Attributes
lunchbox::Lockable< D, L > Class Template Reference

A convenience structure to hold data together with a lock for access. More...

#include <lockable.h>

+ Inheritance diagram for lunchbox::Lockable< D, L >:
+ Collaboration diagram for lunchbox::Lockable< D, L >:

List of all members.

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
Lockableoperator= (const D &rhs)
 Assign another value to the data.

Public Attributes

data
lock

Detailed Description

template<class D, class L = Lock>
class lunchbox::Lockable< D, L >

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.


Constructor & Destructor Documentation

template<class D, class L = Lock>
lunchbox::Lockable< D, L >::Lockable ( ) [inline, explicit]

Construct a new lockable data structure.

Version:
1.0

Definition at line 36 of file lockable.h.

template<class D, class L = Lock>
lunchbox::Lockable< D, L >::Lockable ( const D &  value) [inline, explicit]

Construct and initialize a new data structure.

Version:
1.0

Definition at line 39 of file lockable.h.

template<class D, class L = Lock>
template<class P1 >
lunchbox::Lockable< D, L >::Lockable ( const P1 &  p1) [inline]

Construct and initialize a new data structure.

Version:
1.3.2

Definition at line 42 of file lockable.h.


Member Function Documentation

template<class D, class L = Lock>
D& lunchbox::Lockable< D, L >::operator* ( ) [inline]

Access the held data.

Version:
1.1.5

Definition at line 51 of file lockable.h.

template<class D, class L = Lock>
const D& lunchbox::Lockable< D, L >::operator* ( ) const [inline]

Access the held data.

Version:
1.1.5

Definition at line 54 of file lockable.h.

template<class D, class L = Lock>
D* lunchbox::Lockable< D, L >::operator-> ( ) [inline]

Access the held data.

Version:
1.0

Definition at line 45 of file lockable.h.

template<class D, class L = Lock>
const D* lunchbox::Lockable< D, L >::operator-> ( ) const [inline]

Access the held data.

Version:
1.0

Definition at line 48 of file lockable.h.

template<class D, class L = Lock>
Lockable& lunchbox::Lockable< D, L >::operator= ( const D &  rhs) [inline]

Assign another value to the data.

Version:
1.0

Definition at line 60 of file lockable.h.

template<class D, class L = Lock>
bool lunchbox::Lockable< D, L >::operator== ( const D &  rhs) const [inline]
Returns:
true if the data is equal to the rhs object.
Version:
1.0

Definition at line 57 of file lockable.h.


The documentation for this class was generated from the following file: