Public Member Functions | Protected Attributes

zeus::TAtomicCounter Class Reference

#include <AtomicCounter.hpp>

List of all members.

Public Member Functions

 TAtomicCounter ()
 TAtomicCounter (Int32 lValue)
 TAtomicCounter (const TAtomicCounter &rValue)
virtual ~TAtomicCounter ()
Int32 getAndDecrement ()
Int32 getAndIncrement ()
Int32 incrementAndGet ()
Int32 decrementAndGet ()
 operator Int32 () const
Int32 operator++ ()
Int32 operator-- ()
Int32 operator++ (int)
Int32 operator-- (int)
TAtomicCounteroperator= (Int32 lInVal)
TAtomicCounteroperator= (const TAtomicCounter &rInVal)

Protected Attributes

Int32 m_lValue
 internal value
TCriticalSectionm_rLock
 Lock of the atomic value.

Detailed Description

An atomic counter is used to simply increment or decrement a integer value. This class is more optimized than using TAtomicInt. TAtomicInt should be used for complex manipulationes.


Constructor & Destructor Documentation

zeus::TAtomicCounter::TAtomicCounter (  ) [inline]

Creates an atomic counter

zeus::TAtomicCounter::TAtomicCounter ( Int32  lValue ) [inline]

Creates an atomic counter

Parameters:
lValue: Initial value
zeus::TAtomicCounter::TAtomicCounter ( const TAtomicCounter rValue ) [inline]

Creates an atomic counter

virtual zeus::TAtomicCounter::~TAtomicCounter (  ) [inline, virtual]

Destroys the atomic counter


Member Function Documentation

Int32 zeus::TAtomicCounter::decrementAndGet (  ) [inline]

decrements the counter by one

Int32 zeus::TAtomicCounter::getAndDecrement (  ) [inline]

returns the value before decrementing it

Int32 zeus::TAtomicCounter::getAndIncrement (  ) [inline]

returns the value before incrementing it

Int32 zeus::TAtomicCounter::incrementAndGet (  ) [inline]

increments the counter by one

zeus::TAtomicCounter::operator Int32 (  ) const [inline]

returns the counter

Int32 zeus::TAtomicCounter::operator++ ( int   ) [inline]

increments the counter by one after returning the value (post increment)

Int32 zeus::TAtomicCounter::operator++ (  ) [inline]

increments the counter by one

Int32 zeus::TAtomicCounter::operator-- (  ) [inline]

decrements the counter by one

Int32 zeus::TAtomicCounter::operator-- ( int   ) [inline]

decrements the counter by one after returning the value (post decrement)

TAtomicCounter& zeus::TAtomicCounter::operator= ( const TAtomicCounter rInVal ) [inline]

Assigns an atomic counter

TAtomicCounter& zeus::TAtomicCounter::operator= ( Int32  lInVal ) [inline]

Assigns an atomic counter


Member Data Documentation

internal value

Lock of the atomic value.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Sun Jan 22 2012 15:28:32