MADNESS  version 0.9
Public Member Functions | List of all members
madness::AtomicInt Class Reference

An integer with atomic set, get, read+inc, read+dec, dec+test operations. More...

#include <atomicint.h>

Public Member Functions

 operator int () const volatile
 Returns the value of the counter with fence ensuring subsequent operations are not moved before the load. More...
 
int operator= (int other)
 Sets the value of the counter with fence ensuring preceding operations are not moved after the store. More...
 
AtomicIntoperator= (const AtomicInt &other)
 Sets the value of the counter with fences ensuring operations are not moved either side of the load+store. More...
 
int operator-- (int)
 Decrements the counter and returns the original value. More...
 
int operator-- ()
 Decrements the counter and returns the incremented value. More...
 
int operator++ (int)
 Increments the counter and returns the original value. More...
 
int operator++ ()
 Increments the counter and returns the incremented value. More...
 
int operator+= (const int value)
 Add value and returns the new value. More...
 
int operator-= (const int value)
 Subtract value and returns the new value. More...
 
bool dec_and_test ()
 Decrements the counter and returns true if the new value is zero. More...
 

Detailed Description

An integer with atomic set, get, read+inc, read+dec, dec+test operations.

Only the default constructor is available and IT DOES NOT INITIALIZE THE VARIABLE.

Conciously modeled after the TBB API to prepare for switching to it.

Member Function Documentation

bool madness::AtomicInt::dec_and_test ( )
inline
madness::AtomicInt::operator int ( ) const volatile
inline

Returns the value of the counter with fence ensuring subsequent operations are not moved before the load.

int madness::AtomicInt::operator++ ( int  )
inline

Increments the counter and returns the original value.

int madness::AtomicInt::operator++ ( )
inline

Increments the counter and returns the incremented value.

int madness::AtomicInt::operator+= ( const int  value)
inline

Add value and returns the new value.

int madness::AtomicInt::operator-- ( int  )
inline

Decrements the counter and returns the original value.

int madness::AtomicInt::operator-- ( )
inline

Decrements the counter and returns the incremented value.

int madness::AtomicInt::operator-= ( const int  value)
inline

Subtract value and returns the new value.

int madness::AtomicInt::operator= ( int  other)
inline

Sets the value of the counter with fence ensuring preceding operations are not moved after the store.

AtomicInt& madness::AtomicInt::operator= ( const AtomicInt other)
inline

Sets the value of the counter with fences ensuring operations are not moved either side of the load+store.


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