Equalizer 1.0

co::base::PerThread< T > Class Template Reference

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

#include <perThread.h>

Inheritance diagram for co::base::PerThread< T >:
Collaboration diagram for co::base::PerThread< T >:

List of all members.

Public Member Functions

 PerThread ()
 Construct a new per-thread variable.
 ~PerThread ()
 Destruct the per-thread variable.
PerThread< T > & operator= (const T *data)
 Assign an object to the thread-local storage.
PerThread< T > & operator= (const PerThread< T > &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

Protected Member Functions

virtual void notifyExecutionStopping ()
 Notify that the execution unit is about to stop.

Detailed Description

template<typename T>
class co::base::PerThread< T >

Implements thread-specific storage for C++ objects.

The object is deleted on thread exit.

To instantiate the template code for this class, applications have to include pthread.h before this file. pthread.h is not automatically included to avoid hard to resolve type conflicts with other header files on Windows.

Definition at line 43 of file perThread.h.


Constructor & Destructor Documentation

template<typename T>
co::base::PerThread< T >::PerThread ( )

Construct a new per-thread variable.

Version:
1.0
template<typename T>
co::base::PerThread< T >::~PerThread ( )

Destruct the per-thread variable.

Version:
1.0

Member Function Documentation

template<typename T>
T* co::base::PerThread< T >::get ( )
Returns:
the held object pointer.
Version:
1.0

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

Here is the caller graph for this function:

template<typename T>
const T* co::base::PerThread< T >::get ( ) const
Returns:
the held object pointer.
Version:
1.0
template<typename T>
bool co::base::PerThread< T >::isValid ( ) const
Returns:
true if the thread-local storage holds a non-0 pointer.
Version:
1.0
template<typename T>
virtual void co::base::PerThread< T >::notifyExecutionStopping ( ) [protected, virtual]

Notify that the execution unit is about to stop.

Version:
1.0

Reimplemented from co::base::ExecutionListener.

template<typename T>
bool co::base::PerThread< T >::operator! ( ) const
Returns:
true if the thread-local storage holds a 0 pointer.
Version:
1.0
template<typename T>
bool co::base::PerThread< T >::operator!= ( const T *  rhs) const [inline]
Returns:
true if the thread-local variable holds another object.
Version:
1.0

Definition at line 90 of file perThread.h.

template<typename T>
const T& co::base::PerThread< T >::operator* ( ) const [inline]
Returns:
the held object reference.
Version:
1.0

Definition at line 70 of file perThread.h.

References co::base::className().

Here is the call graph for this function:

template<typename T>
T& co::base::PerThread< T >::operator* ( ) [inline]
Returns:
the held object reference.
Version:
1.0

Definition at line 67 of file perThread.h.

References co::base::className().

Here is the call graph for this function:

template<typename T>
const T* co::base::PerThread< T >::operator-> ( ) const

Access the thread-local object.

Version:
1.0
template<typename T>
T* co::base::PerThread< T >::operator-> ( )

Access the thread-local object.

Version:
1.0
template<typename T>
PerThread<T>& co::base::PerThread< T >::operator= ( const PerThread< T > &  rhs)

Assign an object from another thread-local storage.

Version:
1.0
template<typename T>
PerThread<T>& co::base::PerThread< T >::operator= ( const T *  data)

Assign an object to the thread-local storage.

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

Definition at line 84 of file perThread.h.

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

Definition at line 77 of file perThread.h.

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

Here is the call graph for this function:


The documentation for this class was generated from the following file:
Generated on Sun May 8 2011 19:11:09 for Equalizer 1.0 by  doxygen 1.7.3