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

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

#include <perThread.h>

Inheritance diagram for eq::base::PerThread< T >:
Inheritance graph
[legend]
Collaboration diagram for eq::base::PerThread< T >:
Collaboration graph
[legend]

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.
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 eq::base::PerThread< T >

Implements thread-specific storage for C++ objects.

The object has to implement notifyPerThreadDelete().

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 44 of file perThread.h.


Constructor & Destructor Documentation

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

Construct a new per-thread variable.

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

Destruct the per-thread variable.

Version:
1.0

Member Function Documentation

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

Assign an object to the thread-local storage.

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

Assign an object from another thread-local storage.

Version:
1.0

Reimplemented from eq::base::NonCopyable.

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

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

Here is the caller graph for this function:

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

Access the thread-local object.

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

Access the thread-local object.

Version:
1.0
template<typename T>
bool eq::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 71 of file perThread.h.

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

Here is the call graph for this function:

template<typename T>
bool eq::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 78 of file perThread.h.

template<typename T>
bool eq::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 84 of file perThread.h.

template<typename T>
bool eq::base::PerThread< T >::operator! (  )  const
Returns:
true if the thread-local storage holds a 0 pointer.
Version:
1.0
template<typename T>
bool eq::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 eq::base::PerThread< T >::notifyExecutionStopping (  )  [protected, virtual]

Notify that the execution unit is about to stop.

Version:
1.0

Reimplemented from eq::base::ExecutionListener.


The documentation for this class was generated from the following file:
Generated on Sat Feb 6 13:08:15 2010 for Equalizer 0.9.1 by  doxygen 1.6.1