The AtomicCounter class offers thread-safe manipulation of an integer counter.
More...
#include <thread.h>
List of all members.
Detailed Description
The AtomicCounter class offers thread-safe manipulation of an integer counter.
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> atomic counter operation.
Constructor & Destructor Documentation
ost::AtomicCounter::AtomicCounter |
( |
| ) |
|
Initialize an atomic counter to 0.
ost::AtomicCounter::AtomicCounter |
( |
int |
value | ) |
|
Initialize an atomic counter to a known value.
- Parameters:
-
ost::AtomicCounter::~AtomicCounter |
( |
| ) |
|
Member Function Documentation
ost::AtomicCounter::operator int |
( |
| ) |
|
bool ost::AtomicCounter::operator! |
( |
void |
| ) |
|
int ost::AtomicCounter::operator+ |
( |
int |
change | ) |
|
int ost::AtomicCounter::operator++ |
( |
void |
| ) |
|
int ost::AtomicCounter::operator+= |
( |
int |
change | ) |
|
int ost::AtomicCounter::operator- |
( |
int |
change | ) |
|
int ost::AtomicCounter::operator-- |
( |
void |
| ) |
|
int ost::AtomicCounter::operator-= |
( |
int |
change | ) |
|
int ost::AtomicCounter::operator= |
( |
int |
value | ) |
|
The documentation for this class was generated from the following file: