+
class TAtomicCount
-
library: libThread
#include "TAtomicCount.h"
Display options:
Show inherited
Show non-public

class TAtomicCount


TAtomicCount

Class providing atomic operations on a long. Setting, getting,
incrementing and decrementing are atomic, thread safe, operations.

TAtomicCount a(n);

(n is convertible to long)

Effects: Constructs an TAtomicCount with an initial value of n.

long(a);

Returns: (long) the current value of a.

++a;

Effects: Atomically increments the value of a.
Returns: nothing.

--a;

Effects: Atomically decrements the value of a.
Returns: (long) zero if the new value of a is zero,
unspecified non-zero value otherwise
(usually the new value).

a.Set(n);

Effects: Set a to the value n.
Returns: nothing.

a.Get();

Returns: (long) the current value of a.



Function Members (Methods)

public:
TAtomicCount(Long_t v)
~TAtomicCount()
Long_tGet() const
longoperator long() const
voidoperator++()
Long_toperator--()
voidSet(Long_t v)
private:
TAtomicCount(const TAtomicCount&)
TAtomicCount&operator=(const TAtomicCount&)

Data Members

private:
Long_tfCntcounter

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TAtomicCount(const TAtomicCount &)
TAtomicCount & operator=(const TAtomicCount& )
explicit TAtomicCount(Long_t v)
{ }
void operator++()
{ ++fCnt; }
Long_t operator--()
{ return --fCnt; }
operator long()
{ return fCnt; }
void Set(Long_t v)
{ fCnt = v; }
Long_t Get()
{ return fCnt; }

Last update: Mon Jun 25 19:46:24 2007

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.