#include <critsec.h>
Public Types | |
typedef int | IntegerType |
Public Member Functions | |
PAtomicInteger (IntegerType value=0) | |
~PAtomicInteger () | |
Destroy the atomic integer. | |
__inline | operator IntegerType () const |
__inline PAtomicInteger & | operator= (const PAtomicInteger &ref) |
Assign a value to the atomic integer. | |
void | SetValue (IntegerType value) |
Set the value of the atomic integer. | |
__inline bool | IsZero () const |
__inline bool | operator! () const |
Test if atomic integer has a non-zero value. | |
IntegerType | operator++ () |
IntegerType | operator++ (int) |
IntegerType | operator-- () |
IntegerType | operator-- (int) |
Protected Attributes | |
pthread_mutex_t | m_mutex |
IntegerType | m_value |
typedef int PAtomicInteger::IntegerType |
__inline PAtomicInteger::PAtomicInteger | ( | IntegerType | value = 0 |
) | [explicit] |
Create a PAtomicInteger with the specified initial value
value | initial value |
__inline PAtomicInteger::~PAtomicInteger | ( | ) |
Destroy the atomic integer.
__inline bool PAtomicInteger::IsZero | ( | ) | const [inline] |
Test if an atomic integer has a zero value. Note that this is a non-atomic test - use the return value of the operator++() or operator--() tests to perform atomic operations
__inline PAtomicInteger::operator IntegerType | ( | ) | const [inline] |
__inline bool PAtomicInteger::operator! | ( | ) | const [inline] |
Test if atomic integer has a non-zero value.
__inline PAtomicInteger::IntegerType PAtomicInteger::operator++ | ( | int | ) |
atomically post-increment the integer value
__inline PAtomicInteger::IntegerType PAtomicInteger::operator++ | ( | ) |
atomically pre-increment the integer value
__inline PAtomicInteger::IntegerType PAtomicInteger::operator-- | ( | int | ) |
atomically post-decrement the integer value
__inline PAtomicInteger::IntegerType PAtomicInteger::operator-- | ( | ) |
atomically pre-decrement the integer value
__inline PAtomicInteger& PAtomicInteger::operator= | ( | const PAtomicInteger & | ref | ) | [inline] |
Assign a value to the atomic integer.
__inline void PAtomicInteger::SetValue | ( | IntegerType | value | ) |
Set the value of the atomic integer.
value | value to set |
pthread_mutex_t PAtomicInteger::m_mutex [protected] |
IntegerType PAtomicInteger::m_value [protected] |