Lunchbox
1.4.0
|
Implements thread-specific storage for C++ objects. More...
#include <perThread.h>
Public Member Functions | |
PerThread () | |
Construct a new per-thread variable. | |
~PerThread () | |
Destruct the per-thread variable. | |
PerThread< T, D > & | operator= (const T *data) |
Assign an object to the thread-local storage. | |
PerThread< T, D > & | operator= (const PerThread< T, D > &rhs) |
Assign an object from another thread-local storage. | |
T * | get () |
const T * | get () const |
T * | operator-> () |
Access the thread-local object. | |
const T * | operator-> () const |
Access the thread-local object. | |
T & | operator* () |
const T & | operator* () const |
bool | operator== (const PerThread &rhs) const |
bool | operator== (const T *rhs) const |
bool | operator!= (const T *rhs) const |
bool | operator! () const |
bool | isValid () const |
Implements thread-specific storage for C++ objects.
The default destructor function deletes the object on thread exit.
To instantiate the template code for this class, applications have to include pthread.h before this file. The pthread.h header is not automatically included to avoid hard to resolve type conflicts with other header files on Windows.
T | the type of data to store in thread-local storage |
D | the destructor callback function. |
Definition at line 50 of file perThread.h.
lunchbox::PerThread< T, D >::PerThread | ( | ) |
Construct a new per-thread variable.
lunchbox::PerThread< T, D >::~PerThread | ( | ) |
Destruct the per-thread variable.
T* lunchbox::PerThread< T, D >::get | ( | ) |
Referenced by lunchbox::PerThread< T, D >::operator==().
const T* lunchbox::PerThread< T, D >::get | ( | ) | const |
bool lunchbox::PerThread< T, D >::isValid | ( | ) | const |
bool lunchbox::PerThread< T, D >::operator! | ( | ) | const |
bool lunchbox::PerThread< T, D >::operator!= | ( | const T * | rhs | ) | const [inline] |
Definition at line 96 of file perThread.h.
T& lunchbox::PerThread< T, D >::operator* | ( | ) | [inline] |
Definition at line 73 of file perThread.h.
References lunchbox::className().
const T& lunchbox::PerThread< T, D >::operator* | ( | ) | const [inline] |
Definition at line 76 of file perThread.h.
References lunchbox::className().
T* lunchbox::PerThread< T, D >::operator-> | ( | ) |
Access the thread-local object.
const T* lunchbox::PerThread< T, D >::operator-> | ( | ) | const |
Access the thread-local object.
PerThread<T, D>& lunchbox::PerThread< T, D >::operator= | ( | const T * | data | ) |
Assign an object to the thread-local storage.
PerThread<T, D>& lunchbox::PerThread< T, D >::operator= | ( | const PerThread< T, D > & | rhs | ) |
Assign an object from another thread-local storage.
bool lunchbox::PerThread< T, D >::operator== | ( | const PerThread< T, D > & | rhs | ) | const [inline] |
Definition at line 83 of file perThread.h.
References lunchbox::PerThread< T, D >::get().
bool lunchbox::PerThread< T, D >::operator== | ( | const T * | rhs | ) | const [inline] |
Definition at line 90 of file perThread.h.