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

InheritableThreadLocal Class Template Reference

#include <InheritableThreadLocal.h>

Inheritance diagram for InheritableThreadLocal:

ThreadLocal AbstractThreadLocal NonCopyable List of all members.

Public Methods

 InheritableThreadLocal () throw ()
 Create a new InheritableThreadLocal object.

virtual ~InheritableThreadLocal () throw ()
 Destroy this InheritableThreadLocal object.


Protected Methods

virtual void * childValue (void *parentValue) const throw ()
virtual bool propogateValue () const throw ()

Detailed Description

template<class T>
class ZThread::InheritableThreadLocal< T >

Author:
Eric Crahen <crahen@cse.buffalo.edu>
Date:
<2002-05-30T17:50:21-0400>
Version:
2.2.0
This object acts exactly like its super class ThreadLocal with one subtle difference. That difference is that parent threads values can automatically be propogated to child threads as they are created.

The childValue() method allows subclasses to alter values for ThreadLocals that propogated from parent threads to thier children created.

See also:
ThreadLocal


Member Function Documentation

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

This method will be invoked by the framework when a child thread is created. If there is a value associated with the parent thread and this object, then this method is invoked from the childs context, after an implicit call to initialValue().

Parameters:
parentValue  - parent threads value for this ThreadLocal
Returns :
value to associate with the current thread (new child) and this object.
Precondition:
The parent must have accessed the ThreadLocal at some point, either with get() or set(), for this method to be invoked. Otherwise, there is no association with the parent thread and this object - and there is no value to propogate.

Reimplemented from AbstractThreadLocal.

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

Inform the framework this value does propogate to child threads

Returns :
true, always

Reimplemented from AbstractThreadLocal.


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