ThreadLocalCounter Class Reference

Thread-local numeric counter. More...

#include <ThreadLocalCounter.h++>

Inheritance diagram for ThreadLocalCounter:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 ThreadLocalCounter () throw ()
 Construct a new ThreadLocalCounter with an initial value of 0.
virtual ~ThreadLocalCounter () throw ()
 Destructor.
int32_t & operator* () throw (NullPointerException)
 Pointer-dereference operator.
int32_t * operator-> () throw (NullPointerException)
 Pointer operator.
void setValue (int32_t *value) throw ()
 Set the value of the thread-local object for the calling thread.
int32_t * getValue () throw ()
 Get the value of the thread-local object for the calling thread.

Static Public Member Functions

static int getSlotCount ()
 Get the maximum number of thread-local storage slots available on this platform.

Protected Member Functions

int32_t * initialValue ()
 Provide the intial value of the thread-local object for the calling thread.

Detailed Description

Thread-local numeric counter.

The counter exists as a separate instance for each calling thread.

Author:
Mark Lindner

Constructor & Destructor Documentation

ThreadLocalCounter (  )  throw ()

Construct a new ThreadLocalCounter with an initial value of 0.

~ThreadLocalCounter (  )  throw () [virtual]

Destructor.


Member Function Documentation

static int getSlotCount (  )  [static, inherited]

Get the maximum number of thread-local storage slots available on this platform.

A return value of -1 indicates that there is no limit.

int32_t * getValue (  )  throw () [inherited]

Get the value of the thread-local object for the calling thread.

Returns:
The current (possibly NULL) value.
int32_t * initialValue (  )  [protected, virtual]

Provide the intial value of the thread-local object for the calling thread.

The default implementation returns NULL.

Returns:
The initial value.

Reimplemented from ThreadLocal< int32_t >.

int32_t & operator* (  )  throw (NullPointerException) [inherited]

Pointer-dereference operator.

Returns:
A reference to the thread-local object.
Exceptions:
NullPointerException If the value of the object was never initialized for the calling thread.
int32_t * operator-> (  )  throw (NullPointerException) [inherited]

Pointer operator.

Returns:
A pointer to the thread-local object.
Exceptions:
NullPointerException If the value of the object was never initialized for the calling thread.
void setValue ( int32_t *  value  )  throw () [inherited]

Set the value of the thread-local object for the calling thread.

Parameters:
value The new value.

The documentation for this class was generated from the following files:
Generated on Sat Nov 26 16:49:09 2011 for libcommonc++ by  doxygen 1.6.3