C++ abstraction of atomic integer operations. More...
#include <rtt/os/Atomic.hpp>
Public Member Functions | |
AtomicInt (int value=0) | |
AtomicInt (const AtomicInt &orig) | |
const AtomicInt & | operator= (const AtomicInt &orig) |
int | read () |
Read the current value of the integer. | |
void | set (int i) |
Set the integer to a new value. | |
void | add (int i) |
oro_atomic_add - add integer to atomic variable : integer value to add | |
void | sub (int i) |
oro_atomic_sub - subtract the atomic variable : integer value to subtract | |
bool | sub_and_test (int i) |
oro_atomic_sub_and_test - subtract value from variable and test result : integer value to subtract | |
void | inc () |
oro_atomic_inc - increment atomic variable | |
void | dec () |
oro_atomic_dec - decrement atomic variable | |
bool | dec_and_test () |
oro_atomic_dec_and_test - decrement and test | |
bool | inc_and_test () |
oro_atomic_inc_and_test - increment and test | |
bool | add_negative (int i) |
oro_atomic_add_negative - add and test if negative : integer value to add |
C++ abstraction of atomic integer operations.
Definition at line 49 of file Atomic.hpp.
void RTT::OS::AtomicInt::add | ( | int | i | ) | [inline] |
oro_atomic_add - add integer to atomic variable : integer value to add
Atomically adds to . Note that the guaranteed useful range of an oro_atomic_t is only 24 bits.
Definition at line 90 of file Atomic.hpp.
bool RTT::OS::AtomicInt::add_negative | ( | int | i | ) | [inline] |
oro_atomic_add_negative - add and test if negative : integer value to add
Atomically adds to and returns true if the result is negative, or false when result is greater than or equal to zero. Note that the guaranteed useful range of an oro_atomic_t is only 24 bits.
Definition at line 150 of file Atomic.hpp.
void RTT::OS::AtomicInt::dec | ( | ) | [inline] |
oro_atomic_dec - decrement atomic variable
Atomically decrements by 1. Note that the guaranteed useful range of an oro_atomic_t is only 24 bits.
Definition at line 122 of file Atomic.hpp.
bool RTT::OS::AtomicInt::dec_and_test | ( | ) | [inline] |
oro_atomic_dec_and_test - decrement and test
Atomically decrements by 1 and returns true if the result is 0, or false for all other cases. Note that the guaranteed useful range of an oro_atomic_t is only 24 bits.
Definition at line 131 of file Atomic.hpp.
void RTT::OS::AtomicInt::inc | ( | ) | [inline] |
oro_atomic_inc - increment atomic variable
Atomically increments by 1. Note that the guaranteed useful range of an oro_atomic_t is only 24 bits.
Definition at line 115 of file Atomic.hpp.
bool RTT::OS::AtomicInt::inc_and_test | ( | ) | [inline] |
oro_atomic_inc_and_test - increment and test
Atomically increments by 1 and returns true if the result is zero, or false for all other cases. Note that the guaranteed useful range of an oro_atomic_t is only 24 bits.
Definition at line 140 of file Atomic.hpp.
void RTT::OS::AtomicInt::sub | ( | int | i | ) | [inline] |
oro_atomic_sub - subtract the atomic variable : integer value to subtract
Atomically subtracts from . Note that the guaranteed useful range of an oro_atomic_t is only 24 bits.
Definition at line 98 of file Atomic.hpp.
bool RTT::OS::AtomicInt::sub_and_test | ( | int | i | ) | [inline] |
oro_atomic_sub_and_test - subtract value from variable and test result : integer value to subtract
Atomically subtracts from and returns true if the result is zero, or false for all other cases. Note that the guaranteed useful range of an oro_atomic_t is only 24 bits.
Definition at line 108 of file Atomic.hpp.