#include <AtomicCounter.hpp>
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) |
| TAtomicCounter & | operator= (Int32 lInVal) |
| TAtomicCounter & | operator= (const TAtomicCounter &rInVal) |
Protected Attributes | |
| Int32 | m_lValue |
| internal value | |
| TCriticalSection & | m_rLock |
| Lock of the atomic value. | |
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.
| zeus::TAtomicCounter::TAtomicCounter | ( | ) | [inline] |
Creates an atomic counter
| zeus::TAtomicCounter::TAtomicCounter | ( | Int32 | lValue ) | [inline] |
Creates an atomic counter
| lValue | : Initial value |
| zeus::TAtomicCounter::TAtomicCounter | ( | const TAtomicCounter & | rValue ) | [inline] |
Creates an atomic counter
| virtual zeus::TAtomicCounter::~TAtomicCounter | ( | ) | [inline, virtual] |
Destroys the atomic counter
| 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
Int32 zeus::TAtomicCounter::m_lValue [protected] |
internal value
TCriticalSection& zeus::TAtomicCounter::m_rLock [protected] |
Lock of the atomic value.