Lunchbox
1.16.0
Multi-threaded C++ toolbox library for all application developers creating high-performance multi-threaded programs.
|
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 57 of file perThread.h.
lunchbox::PerThread< T, D >::PerThread | ( | ) |
lunchbox::PerThread< T, D >::~PerThread | ( | ) |
T * lunchbox::PerThread< T, D >::get | ( | ) |
Definition at line 46 of file perThread.ipp.
References lunchbox::TLS::get().
Referenced by lunchbox::PerThread< T, D >::operator==().
const T * lunchbox::PerThread< T, D >::get | ( | ) | const |
Definition at line 52 of file perThread.ipp.
References lunchbox::TLS::get().
bool lunchbox::PerThread< T, D >::isValid | ( | ) | const |
Definition at line 76 of file perThread.ipp.
References lunchbox::TLS::get().
bool lunchbox::PerThread< T, D >::operator! | ( | ) | const |
Definition at line 70 of file perThread.ipp.
References lunchbox::TLS::get().
|
inline |
Definition at line 106 of file perThread.h.
|
inline |
Definition at line 80 of file perThread.h.
References lunchbox::className().
|
inline |
Definition at line 86 of file perThread.h.
References lunchbox::className().
T * lunchbox::PerThread< T, D >::operator-> | ( | ) |
Access the thread-local object.
Definition at line 58 of file perThread.ipp.
References lunchbox::TLS::get().
const T * lunchbox::PerThread< T, D >::operator-> | ( | ) | const |
Access the thread-local object.
Definition at line 64 of file perThread.ipp.
References lunchbox::TLS::get().
PerThread< T, D > & lunchbox::PerThread< T, D >::operator= | ( | const T * | data | ) |
Assign an object to the thread-local storage.
Definition at line 32 of file perThread.ipp.
References lunchbox::TLS::set().
PerThread< T, D > & lunchbox::PerThread< T, D >::operator= | ( | const PerThread< T, D > & | rhs | ) |
Assign an object from another thread-local storage.
Definition at line 39 of file perThread.ipp.
References lunchbox::TLS::set().
|
inline |
Definition at line 96 of file perThread.h.
References lunchbox::PerThread< T, D >::get().
|
inline |
Definition at line 101 of file perThread.h.