Poster of Linux kernelThe best gift for a Linux geek
ost::AtomicCounter

ost::AtomicCounter

Section: C Library Functions (3) Updated: 16 Feb 2010
Local index Up
 

NAME

ost::AtomicCounter -

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

 

SYNOPSIS


#include <thread.h>  

Public Member Functions


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

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.

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:

value initial value.

 

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)

 

Author

Generated automatically by Doxygen for GNU CommonC++ from the source code.


 

Index

NAME
SYNOPSIS
Public Member Functions
Detailed Description
Constructor & Destructor Documentation
ost::AtomicCounter::AtomicCounter ()
ost::AtomicCounter::AtomicCounter (int value)
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)
Author

This document was created by man2html, using the manual pages.
Time: 21:51:49 GMT, April 16, 2011