Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | List of all members
om::threads::Atomic< T > Class Template Reference

A class that wraps a primitive-type value in atomic operations. More...

#include <omAtomics.h>

Public Member Functions

 Atomic ()
 Create a new atomic variable with the default initial value. More...
 
 Atomic (T newValue)
 Create a new atomic variable with the specified initial value. More...
 
 operator T () const
 Return the current un-boxed atomic value. More...
 
operator++ ()
 Prefix increment operator. More...
 
operator++ (int)
 Postfix increment operator. More...
 
operator-- ()
 Prefix increment operator. More...
 
operator-- (int)
 Postfix increment operator. More...
 
operator+= (T a)
 Add the specified value to this atomic value, returning the result. More...
 
operator-= (T a)
 Subtract the specified value from this atomic value, returning the result. More...
 
operator&= (T a)
 Bitwise AND the specified value and this atomic value, returning the result. More...
 
operator|= (T a)
 Bitwise OR the specified value and this atomic value, returning the result. More...
 
operator^= (T a)
 Bitwise XOR the specified value and this atomic value, returning the result. More...
 
Bool testAndSet (T compareValue=T(0), T newValue=T(1))
 Return whether or not the atomic value was set to the comparison value. If so, set the atomic to the new value. More...
 

Detailed Description

template<typename T>
class om::threads::Atomic< T >

A class that wraps a primitive-type value in atomic operations.

Constructor & Destructor Documentation

template<typename T>
om::threads::Atomic< T >::Atomic ( )
inline

Create a new atomic variable with the default initial value.

template<typename T>
om::threads::Atomic< T >::Atomic ( newValue)
inline

Create a new atomic variable with the specified initial value.

Member Function Documentation

template<typename T>
om::threads::Atomic< T >::operator T ( ) const
inline

Return the current un-boxed atomic value.

template<typename T>
T om::threads::Atomic< T >::operator++ ( )
inline

Prefix increment operator.

template<typename T>
T om::threads::Atomic< T >::operator++ ( int  )
inline

Postfix increment operator.

template<typename T>
T om::threads::Atomic< T >::operator-- ( )
inline

Prefix increment operator.

template<typename T>
T om::threads::Atomic< T >::operator-- ( int  )
inline

Postfix increment operator.

template<typename T>
T om::threads::Atomic< T >::operator+= ( a)
inline

Add the specified value to this atomic value, returning the result.

template<typename T>
T om::threads::Atomic< T >::operator-= ( a)
inline

Subtract the specified value from this atomic value, returning the result.

template<typename T>
T om::threads::Atomic< T >::operator&= ( a)
inline

Bitwise AND the specified value and this atomic value, returning the result.

template<typename T>
T om::threads::Atomic< T >::operator|= ( a)
inline

Bitwise OR the specified value and this atomic value, returning the result.

template<typename T>
T om::threads::Atomic< T >::operator^= ( a)
inline

Bitwise XOR the specified value and this atomic value, returning the result.

template<typename T>
Bool om::threads::Atomic< T >::testAndSet ( compareValue = T(0),
newValue = T(1) 
)
inline

Return whether or not the atomic value was set to the comparison value. If so, set the atomic to the new value.


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