Equalizer  1.2.1
Public Member Functions
co::base::PerThread< T, D > Class Template Reference

Implements thread-specific storage for C++ objects. More...

#include <perThread.h>

+ Inheritance diagram for co::base::PerThread< T, D >:
+ Collaboration diagram for co::base::PerThread< T, D >:

List of all members.

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

Detailed Description

template<class T, void(*)(T *) D = perThreadDelete< T >>
class co::base::PerThread< T, D >

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.

Parameters:
Tthe type of data to store in thread-local storage
Dthe destructor callback function.

Definition at line 52 of file perThread.h.


Constructor & Destructor Documentation

template<class T, void(*)(T *) D = perThreadDelete< T >>
co::base::PerThread< T, D >::PerThread ( )

Construct a new per-thread variable.

Version:
1.0
template<class T, void(*)(T *) D = perThreadDelete< T >>
co::base::PerThread< T, D >::~PerThread ( )

Destruct the per-thread variable.

Version:
1.0

Member Function Documentation

template<class T, void(*)(T *) D = perThreadDelete< T >>
T* co::base::PerThread< T, D >::get ( )
Returns:
the held object pointer.
Version:
1.0

Referenced by co::base::PerThread< T, D >::operator==().

+ Here is the caller graph for this function:

template<class T, void(*)(T *) D = perThreadDelete< T >>
const T* co::base::PerThread< T, D >::get ( ) const
Returns:
the held object pointer.
Version:
1.0
template<class T, void(*)(T *) D = perThreadDelete< T >>
bool co::base::PerThread< T, D >::isValid ( ) const
Returns:
true if the thread-local storage holds a non-0 pointer.
Version:
1.0
template<class T, void(*)(T *) D = perThreadDelete< T >>
bool co::base::PerThread< T, D >::operator! ( ) const
Returns:
true if the thread-local storage holds a 0 pointer.
Version:
1.0
template<class T, void(*)(T *) D = perThreadDelete< T >>
bool co::base::PerThread< T, D >::operator!= ( const T *  rhs) const [inline]
Returns:
true if the thread-local variable holds another object.
Version:
1.0

Definition at line 98 of file perThread.h.

template<class T, void(*)(T *) D = perThreadDelete< T >>
T& co::base::PerThread< T, D >::operator* ( ) [inline]
Returns:
the held object reference.
Version:
1.0

Definition at line 75 of file perThread.h.

References co::base::className().

+ Here is the call graph for this function:

template<class T, void(*)(T *) D = perThreadDelete< T >>
const T& co::base::PerThread< T, D >::operator* ( ) const [inline]
Returns:
the held object reference.
Version:
1.0

Definition at line 78 of file perThread.h.

References co::base::className().

+ Here is the call graph for this function:

template<class T, void(*)(T *) D = perThreadDelete< T >>
T* co::base::PerThread< T, D >::operator-> ( )

Access the thread-local object.

Version:
1.0
template<class T, void(*)(T *) D = perThreadDelete< T >>
const T* co::base::PerThread< T, D >::operator-> ( ) const

Access the thread-local object.

Version:
1.0
template<class T, void(*)(T *) D = perThreadDelete< T >>
PerThread<T, D>& co::base::PerThread< T, D >::operator= ( const T *  data)

Assign an object to the thread-local storage.

Version:
1.0
template<class T, void(*)(T *) D = perThreadDelete< T >>
PerThread<T, D>& co::base::PerThread< T, D >::operator= ( const PerThread< T, D > &  rhs)

Assign an object from another thread-local storage.

Version:
1.0
template<class T, void(*)(T *) D = perThreadDelete< T >>
bool co::base::PerThread< T, D >::operator== ( const PerThread< T, D > &  rhs) const [inline]
Returns:
true if the thread-local variables hold the same object.
Version:
1.0

Definition at line 85 of file perThread.h.

References co::base::PerThread< T, D >::get().

+ Here is the call graph for this function:

template<class T, void(*)(T *) D = perThreadDelete< T >>
bool co::base::PerThread< T, D >::operator== ( const T *  rhs) const [inline]
Returns:
true if the thread-local variable holds the same object.
Version:
1.0

Definition at line 92 of file perThread.h.


The documentation for this class was generated from the following file:
Generated on Fri Jun 8 2012 15:44:34 for Equalizer 1.2.1 by  doxygen 1.8.0