Lunchbox
1.11.0
|
Implements thread-specific storage for C++ objects. More...
#include <perThread.h>
Public Member Functions | |
PerThread () | |
Construct a new per-thread variable. More... | |
~PerThread () | |
Destruct the per-thread variable. More... | |
PerThread< T, D > & | operator= (const T *data) |
Assign an object to the thread-local storage. More... | |
PerThread< T, D > & | operator= (const PerThread< T, D > &rhs) |
Assign an object from another thread-local storage. More... | |
T * | get () |
const T * | get () const |
T * | operator-> () |
Access the thread-local object. More... | |
const T * | operator-> () const |
Access the thread-local object. More... | |
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.
T | the type of data to store in thread-local storage |
D | the destructor callback function. |
Example:
Definition at line 46 of file perThread.h.
lunchbox::PerThread< T, D >::PerThread | ( | ) |
lunchbox::PerThread< T, D >::~PerThread | ( | ) |
T * lunchbox::PerThread< T, D >::get | ( | ) |
Definition at line 41 of file perThread.ipp.
Referenced by lunchbox::PerThread< T, D >::operator==().
const T * lunchbox::PerThread< T, D >::get | ( | ) | const |
bool lunchbox::PerThread< T, D >::isValid | ( | ) | const |
Definition at line 67 of file perThread.ipp.
bool lunchbox::PerThread< T, D >::operator! | ( | ) | const |
Definition at line 62 of file perThread.ipp.
|
inline |
Definition at line 92 of file perThread.h.
|
inline |
Definition at line 69 of file perThread.h.
References lunchbox::className().
|
inline |
Definition at line 72 of file perThread.h.
References lunchbox::className().
T * lunchbox::PerThread< T, D >::operator-> | ( | ) |
const T * lunchbox::PerThread< T, D >::operator-> | ( | ) | const |
PerThread< T, D > & lunchbox::PerThread< T, D >::operator= | ( | const T * | data | ) |
Assign an object to the thread-local storage.
Definition at line 28 of file perThread.ipp.
PerThread< T, D > & lunchbox::PerThread< T, D >::operator= | ( | const PerThread< T, D > & | rhs | ) |
Assign an object from another thread-local storage.
Definition at line 35 of file perThread.ipp.
References lunchbox::TLS::get().
|
inline |
Definition at line 79 of file perThread.h.
References lunchbox::PerThread< T, D >::get().
|
inline |
Definition at line 86 of file perThread.h.