RAUL  0.8.0
Public Member Functions
Raul::AtomicInt Class Reference

Atomic integer. More...

#include <AtomicInt.hpp>

List of all members.

Public Member Functions

 AtomicInt (int val)
 AtomicInt (const AtomicInt &copy)
int get () const
void operator= (int val)
void operator+= (int val)
void operator-= (int val)
bool operator== (int val) const
int operator+ (int val) const
AtomicIntoperator++ ()
AtomicIntoperator-- ()
bool compare_and_exchange (int old, int val)
 Set value to val iff current value is old.
int exchange_and_add (int val)
 Add val to value.
bool decrement_and_test ()
 Decrement value.

Detailed Description

Atomic integer.


Member Function Documentation

bool Raul::AtomicInt::compare_and_exchange ( int  old,
int  val 
) [inline]

Set value to val iff current value is old.

Returns:
true iff set succeeded.
int Raul::AtomicInt::exchange_and_add ( int  val) [inline]

Add val to value.

Returns:
value immediately before addition took place.

Decrement value.

Returns:
true if value is now 0, otherwise false.

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