Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
threading::ThreadLocalDataHolder< T > Class Template Reference

#include <BoostThreads.hh>

List of all members.

Classes

class  Holder

Public Types

typedef T data_type
typedef T data_type
typedef T data_type

Public Member Functions

Tget () const
Tget () const
Tget () const
Tget () const
Tget () const
Toperator* () const
Toperator* () const
Toperator* () const
Toperator* () const
Toperator* () const
Toperator-> () const
Toperator-> () const
Toperator-> () const
Toperator-> () const
Toperator-> () const
Trelease ()
Trelease ()
Trelease ()
Trelease ()
Trelease ()
void reset (T *p=NULL)
void reset (T *p=NULL)
void reset (T *p=NULL)
void reset (T *p=NULL)
void reset (T *p=NULL)
 ThreadLocalDataHolder ()
 ThreadLocalDataHolder ()
 ThreadLocalDataHolder ()
 ThreadLocalDataHolder ()
 ~ThreadLocalDataHolder ()
 ~ThreadLocalDataHolder ()
 ~ThreadLocalDataHolder ()
 ~ThreadLocalDataHolder ()

Static Public Member Functions

static void freeHolder (void *p)

Private Attributes

T_data
pthread_key_t _key
omni_thread::key_t _key
DWORD _key
boost::thread_specific_ptr< T_localData

Detailed Description

template<typename T>
class threading::ThreadLocalDataHolder< T >

This class holds Thread local data of type T, i.e. for each thread a ThreadLocalDataHolder holds 0 or 1 instance of T. The held object must be heap allocated and will be deleted upon termination of the thread to which it belongs.

This class holds Thread local data of type T, i.e. for each thread a ThreadLocalDataHolder holds 0 or 1 instance of T. The held object must be heap allocated and will be deleted upon termination of the thread to wich it belongs. This is an omni_threads based equivalent of Boost.Threads thread_specific_ptr<T> class.

Definition at line 32 of file BoostThreads.hh.


Member Typedef Documentation

template<typename T >
typedef T threading::ThreadLocalDataHolder< T >::data_type

Definition at line 34 of file DummyThreads.hh.

template<typename T >
typedef T threading::ThreadLocalDataHolder< T >::data_type

Definition at line 50 of file OmniThreads.hh.

template<typename T >
typedef T threading::ThreadLocalDataHolder< T >::data_type

Definition at line 115 of file PThreads.hh.


Constructor & Destructor Documentation

template<typename T >
threading::ThreadLocalDataHolder< T >::ThreadLocalDataHolder ( ) [inline]

Definition at line 36 of file DummyThreads.hh.

template<typename T >
threading::ThreadLocalDataHolder< T >::~ThreadLocalDataHolder ( ) [inline]

Definition at line 37 of file DummyThreads.hh.

template<typename T >
threading::ThreadLocalDataHolder< T >::ThreadLocalDataHolder ( ) [inline]

Definition at line 103 of file MSThreads.hh.

template<typename T >
threading::ThreadLocalDataHolder< T >::~ThreadLocalDataHolder ( ) [inline]

Definition at line 106 of file MSThreads.hh.

template<typename T >
threading::ThreadLocalDataHolder< T >::ThreadLocalDataHolder ( ) [inline]

Definition at line 52 of file OmniThreads.hh.

template<typename T >
threading::ThreadLocalDataHolder< T >::~ThreadLocalDataHolder ( ) [inline]

Definition at line 55 of file OmniThreads.hh.

template<typename T >
threading::ThreadLocalDataHolder< T >::ThreadLocalDataHolder ( ) [inline]

Definition at line 117 of file PThreads.hh.

template<typename T >
threading::ThreadLocalDataHolder< T >::~ThreadLocalDataHolder ( ) [inline]

Definition at line 126 of file PThreads.hh.


Member Function Documentation

template<typename T >
static void threading::ThreadLocalDataHolder< T >::freeHolder ( void *  p) [inline, static]

Definition at line 121 of file PThreads.hh.

template<typename T >
T* threading::ThreadLocalDataHolder< T >::get ( ) const [inline]

Definition at line 34 of file BoostThreads.hh.

template<typename T >
T* threading::ThreadLocalDataHolder< T >::get ( ) const [inline]

Definition at line 42 of file DummyThreads.hh.

template<typename T >
T* threading::ThreadLocalDataHolder< T >::get ( ) const [inline]

Obtains the Object held for the current thread.

Returns:
a pointer to the held Object or NULL if no Object has been set for the current thread.

Definition at line 62 of file OmniThreads.hh.

template<typename T >
T* threading::ThreadLocalDataHolder< T >::get ( ) const [inline]

Obtains the Object held for the current thread.

Returns:
a pointer to the held Object or NULL if no Object has been set for the current thread.

Definition at line 115 of file MSThreads.hh.

template<typename T >
T* threading::ThreadLocalDataHolder< T >::get ( ) const [inline]

Definition at line 134 of file PThreads.hh.

template<typename T >
T& threading::ThreadLocalDataHolder< T >::operator* ( void  ) const [inline]

Definition at line 39 of file BoostThreads.hh.

template<typename T >
T& threading::ThreadLocalDataHolder< T >::operator* ( void  ) const [inline]

Definition at line 47 of file DummyThreads.hh.

template<typename T >
T& threading::ThreadLocalDataHolder< T >::operator* ( void  ) const [inline]

Obtains the Object held for the current thread.

Precondition:
get() != NULL
Returns:
a reference to the held Object.

Definition at line 81 of file OmniThreads.hh.

template<typename T >
T& threading::ThreadLocalDataHolder< T >::operator* ( void  ) const [inline]

Obtains the Object held for the current thread.

Precondition:
get() != NULL
Returns:
a reference to the held Object.

Definition at line 132 of file MSThreads.hh.

template<typename T >
T& threading::ThreadLocalDataHolder< T >::operator* ( void  ) const [inline]

Definition at line 139 of file PThreads.hh.

template<typename T >
T* threading::ThreadLocalDataHolder< T >::operator-> ( void  ) const [inline]

Definition at line 38 of file BoostThreads.hh.

template<typename T >
T* threading::ThreadLocalDataHolder< T >::operator-> ( void  ) const [inline]

Definition at line 46 of file DummyThreads.hh.

template<typename T >
T* threading::ThreadLocalDataHolder< T >::operator-> ( void  ) const [inline]

Obtains the Object held for the current thread. Initially each thread holds NULL.

Returns:
a pointer to the held Object or NULL if no Object has been set for the current thread.

Definition at line 74 of file OmniThreads.hh.

template<typename T >
T* threading::ThreadLocalDataHolder< T >::operator-> ( void  ) const [inline]

Obtains the Object held for the current thread. Initially each thread holds NULL.

Returns:
a pointer to the held Object or NULL if no Object has been set for the current thread.

Definition at line 125 of file MSThreads.hh.

template<typename T >
T* threading::ThreadLocalDataHolder< T >::operator-> ( void  ) const [inline]

Definition at line 138 of file PThreads.hh.

template<typename T >
T* threading::ThreadLocalDataHolder< T >::release ( ) [inline]

Definition at line 41 of file BoostThreads.hh.

template<typename T >
T* threading::ThreadLocalDataHolder< T >::release ( ) [inline]

Definition at line 49 of file DummyThreads.hh.

template<typename T >
T* threading::ThreadLocalDataHolder< T >::release ( ) [inline]

Releases the Object held for the current thread.

Postcondition:
get() == NULL
Returns:
a pointer to the Object thas was held for the current thread or NULL if no Object was held.

Definition at line 89 of file OmniThreads.hh.

template<typename T >
T* threading::ThreadLocalDataHolder< T >::release ( ) [inline]

Releases the Object held for the current thread.

Postcondition:
get() == NULL
Returns:
a pointer to the Object thas was held for the current thread or NULL if no Object was held.

Definition at line 140 of file MSThreads.hh.

template<typename T >
T* threading::ThreadLocalDataHolder< T >::release ( ) [inline]

Definition at line 141 of file PThreads.hh.

template<typename T >
void threading::ThreadLocalDataHolder< T >::reset ( T p = NULL) [inline]

Definition at line 45 of file BoostThreads.hh.

template<typename T >
void threading::ThreadLocalDataHolder< T >::reset ( T p = NULL) [inline]

Definition at line 56 of file DummyThreads.hh.

template<typename T >
void threading::ThreadLocalDataHolder< T >::reset ( T p = NULL) [inline]

Sets a new Object to be held for the current thread. A previously set Object will be deleted.

Parameters:
pthe new object to hold.
Postcondition:
get() == p

Definition at line 108 of file OmniThreads.hh.

template<typename T >
void threading::ThreadLocalDataHolder< T >::reset ( T p = NULL) [inline]

Definition at line 148 of file PThreads.hh.

template<typename T >
void threading::ThreadLocalDataHolder< T >::reset ( T p = NULL) [inline]

Sets a new Object to be held for the current thread. A previously set Object will be deleted.

Parameters:
pthe new object to hold.
Postcondition:
get() == p

Definition at line 152 of file MSThreads.hh.


Member Data Documentation

template<typename T >
T* threading::ThreadLocalDataHolder< T >::_data [private]

Definition at line 60 of file DummyThreads.hh.

template<typename T >
pthread_key_t threading::ThreadLocalDataHolder< T >::_key [private]

Definition at line 112 of file PThreads.hh.

template<typename T >
omni_thread::key_t threading::ThreadLocalDataHolder< T >::_key [private]

Definition at line 134 of file OmniThreads.hh.

template<typename T >
DWORD threading::ThreadLocalDataHolder< T >::_key [private]

Definition at line 156 of file MSThreads.hh.

template<typename T >
boost::thread_specific_ptr<T> threading::ThreadLocalDataHolder< T >::_localData [private]

Definition at line 47 of file BoostThreads.hh.


The documentation for this class was generated from the following files:


rc_visard_driver
Author(s): Heiko Hirschmueller , Christian Emmerich , Felix Ruess
autogenerated on Thu Jun 6 2019 20:43:12