Main Page   Namespace List   Class Hierarchy   Compound List   Namespace Members   Compound Members  

AbstractThreadLocal Class Reference

#include <AbstractThreadLocal.h>

Inheritance diagram for AbstractThreadLocal:

NonCopyable ThreadLocal InheritableThreadLocal List of all members.

Public Methods

 AbstractThreadLocal ()
 Create a new AbstractThreadLocal.

virtual ~AbstractThreadLocal () throw ()
 Destroy this AbstractThreadLocal.

virtual void * initialValue () const=0 throw ()
virtual void * childValue (void *parentValue) const throw ()
virtual bool propogateValue () const throw ()
virtual void destroyValue (void *currentValue) const throw ()

Protected Methods

void * get () const throw ()
void * set (void *) const throw ()

Detailed Description

Author:
Eric Crahen <crahen@cse.buffalo.edu>
Date:
<2002-05-30T17:33:30-0400>
Version:
2.2.0
This defines a common base class that helps to support the behavior ThreadLocal objects.

See also:
ThreadLocal , InheritableThreadLocal


Member Function Documentation

virtual void* childValue void *    parentValue const throw () [inline, virtual]
 

Invoked by the framework whenever the value associated with current thread and object is about to propogate to a child thread. This method is not invoked if there is no value associated with the current thread and this object.

Parameters:
void  * - related initialization value

Reimplemented in InheritableThreadLocal.

virtual void destroyValue void *    currentValue const throw () [inline, virtual]
 

Invoked by the framework when a thread that has set a value for a ThreadLocal is about to exit. The initialValue() or childValue() methods will set values implicitly and therefore cause this method to be invoked. This acts as a point to insert some some last chance operation for a ThreadLocal, and is often useful as a cleanup point.

Parameters:
currentValue  - value associated with the current thread and this object.

void* get   const throw () [protected]
 

Get the value associated with the current thread and this object via fetch(). If no association exists, then initialValue() is invoked.

Exceptions:
Synchronization_Exception  - thrown if there is an error allocating native thread local storage

Reimplemented in ThreadLocal.

virtual void* initialValue   const throw () [pure virtual]
 

Invoked by the framework the first time get() is invoked by the current thread, if no child value has been propgated. The value return is associated with the current thread and this object.

Implemented in ThreadLocal.

virtual bool propogateValue   const throw () [inline, virtual]
 

Invoked by the framework whenever it needs to be determined wether or not this object should propogate values to child threads.

Parameters:
bool  - true if this value should propgate, otherwise false. Unless overidden, this method will always return false

Reimplemented in InheritableThreadLocal.

void* set void *    const throw () [protected]
 

Set the value associated with the current thread and this object. This value can only be retrieved from the current thread.

Exceptions:
Synchronization_Exception  - thrown if there is an error allocating native thread local storage


The documentation for this class was generated from the following file:
Generated on Tue Aug 27 07:43:10 2002 for ZThread by doxygen1.2.17