ezEngine  Milestone 7
ezAtomicInteger< T > Class Template Reference

Integer class that can be manipulated in an atomic (i.e. thread-safe) fashion. More...

#include <AtomicInteger.h>

Public Member Functions

 EZ_DECLARE_POD_TYPE ()
 
 ezAtomicInteger ()
 Default constructor.
 
 ezAtomicInteger (const T value)
 Initializes the object with a value.
 
 ezAtomicInteger (const ezAtomicInteger< T > &value)
 Copy-constructor.
 
ezAtomicIntegeroperator= (T value)
 Assigns a new integer value to this object.
 
ezAtomicIntegeroperator= (const ezAtomicInteger &value)
 Assignment operator.
 
Increment ()
 Increments the internal value and returns the incremented value.
 
Decrement ()
 Decrements the internal value and returns the decremented value.
 
void Add (T x)
 
void Subtract (T x)
 
void And (T x)
 
void Or (T x)
 
void Xor (T x)
 
void Min (T x)
 
void Max (T x)
 
Set (T x)
 Sets the internal value to x and returns the original internal value.
 
bool TestAndSet (T expected, T x)
 Sets the internal value to x if the internal value is equal to expected and returns true, otherwise does nothing and returns false.
 
 operator T () const
 

Private Attributes

volatile T m_value
 

Detailed Description

template<typename T>
class ezAtomicInteger< T >

Integer class that can be manipulated in an atomic (i.e. thread-safe) fashion.


The documentation for this class was generated from the following files: