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

AtomicCounter Class Reference

The AtomicCounter class offers thread-safe manipulation of an integer counter. atomic counter operation. More...

#include <thread.h>

List of all members.

Public Methods

 AtomicCounter ()
 Initialize an atomic counter to 0. More...

 AtomicCounter (int value)
 Initialize an atomic counter to a known value. More...

int operator++ (void)
int operator-- (void)
int operator+= (int change)
int operator-= (int change)
int operator+ (int change)
int operator- (int change)
int operator= (int value)
bool operator! (void)
 operator int ()


Detailed Description

The AtomicCounter class offers thread-safe manipulation of an integer counter. atomic counter operation.

These are commonly used for building thread-safe "reference" counters for C++ classes. The AtomicCounter depends on the platforms support for "atomic" integer operations, and can alternately substitute a "mutex" if no atomic support exists.

Author:
Sean Cavanaugh <sean@dimensionalrift.com>


Constructor & Destructor Documentation

AtomicCounter::AtomicCounter (    ) 
 

Initialize an atomic counter to 0.

AtomicCounter::AtomicCounter (  int   value ) 
 

Initialize an atomic counter to a known value.

Parameters:
initial   value.


Member Function Documentation

AtomicCounter::operator int (    ) 
 

bool AtomicCounter::operator! (  void   ) 
 

int AtomicCounter::operator+ (  int   change ) 
 

int AtomicCounter::operator++ (  void   ) 
 

int AtomicCounter::operator+= (  int   change ) 
 

int AtomicCounter::operator- (  int   change ) 
 

int AtomicCounter::operator-- (  void   ) 
 

int AtomicCounter::operator-= (  int   change ) 
 

int AtomicCounter::operator= (  int   value ) 
 


The documentation for this class was generated from the following file:
Generated at Tue Nov 20 12:34:34 2001 for CommonC++ by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001