log4cpp 1.1
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
log4cpp::threading::ThreadLocalDataHolder< T > Class Template Reference

This class holds Thread local data of type T, i.e. More...

#include <BoostThreads.hh>

Public Types

typedef T data_type
 
typedef T data_type
 
typedef T data_type
 

Public Member Functions

Tget () const
 
Toperator-> () const
 
Toperator* () const
 
Trelease ()
 
void reset (T *p=NULL)
 
 ThreadLocalDataHolder ()
 
 ~ThreadLocalDataHolder ()
 
Tget () const
 
Toperator-> () const
 
Toperator* () const
 
Trelease ()
 
void reset (T *p=NULL)
 
 ThreadLocalDataHolder ()
 
 ~ThreadLocalDataHolder ()
 
Tget () const
 Obtains the Object held for the current thread.
 
Toperator-> () const
 Obtains the Object held for the current thread.
 
Toperator* () const
 Obtains the Object held for the current thread.
 
Trelease ()
 Releases the Object held for the current thread.
 
void reset (T *p=NULL)
 Sets a new Object to be held for the current thread.
 
 ThreadLocalDataHolder ()
 
 ~ThreadLocalDataHolder ()
 
Tget () const
 Obtains the Object held for the current thread.
 
Toperator-> () const
 Obtains the Object held for the current thread.
 
Toperator* () const
 Obtains the Object held for the current thread.
 
Trelease ()
 Releases the Object held for the current thread.
 
void reset (T *p=NULL)
 Sets a new Object to be held for the current thread.
 
 ThreadLocalDataHolder ()
 
 ~ThreadLocalDataHolder ()
 
Tget () const
 
Toperator-> () const
 
Toperator* () const
 
Trelease ()
 
void reset (T *p=NULL)
 

Static Public Member Functions

static void freeHolder (void *p)
 

Detailed Description

template<typename T>
class log4cpp::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.

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.

Member Typedef Documentation

◆ data_type [1/3]

◆ data_type [2/3]

◆ data_type [3/3]

Constructor & Destructor Documentation

◆ ThreadLocalDataHolder() [1/4]

template<typename T >
log4cpp::threading::ThreadLocalDataHolder< T >::ThreadLocalDataHolder ( )
inline

◆ ~ThreadLocalDataHolder() [1/4]

◆ ThreadLocalDataHolder() [2/4]

template<typename T >
log4cpp::threading::ThreadLocalDataHolder< T >::ThreadLocalDataHolder ( )
inline

◆ ~ThreadLocalDataHolder() [2/4]

◆ ThreadLocalDataHolder() [3/4]

template<typename T >
log4cpp::threading::ThreadLocalDataHolder< T >::ThreadLocalDataHolder ( )
inline

◆ ~ThreadLocalDataHolder() [3/4]

◆ ThreadLocalDataHolder() [4/4]

template<typename T >
log4cpp::threading::ThreadLocalDataHolder< T >::ThreadLocalDataHolder ( )
inline

◆ ~ThreadLocalDataHolder() [4/4]

Member Function Documentation

◆ freeHolder()

template<typename T >
static void log4cpp::threading::ThreadLocalDataHolder< T >::freeHolder ( void * p)
inlinestatic

◆ get() [1/5]

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

◆ get() [2/5]

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

◆ get() [3/5]

template<typename T >
T * log4cpp::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.

◆ get() [4/5]

template<typename T >
T * log4cpp::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.

◆ get() [5/5]

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

◆ operator*() [1/5]

◆ operator*() [2/5]

◆ operator*() [3/5]

Obtains the Object held for the current thread.

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

◆ operator*() [4/5]

Obtains the Object held for the current thread.

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

◆ operator*() [5/5]

◆ operator->() [1/5]

◆ operator->() [2/5]

◆ operator->() [3/5]

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.

◆ operator->() [4/5]

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.

◆ operator->() [5/5]

◆ release() [1/5]

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

◆ release() [2/5]

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

◆ release() [3/5]

template<typename T >
T * log4cpp::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.

◆ release() [4/5]

template<typename T >
T * log4cpp::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.

◆ release() [5/5]

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

◆ reset() [1/5]

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

◆ reset() [2/5]

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

◆ reset() [3/5]

template<typename T >
void log4cpp::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

◆ reset() [4/5]

template<typename T >
void log4cpp::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

◆ reset() [5/5]

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

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