GATE
|
#include <atomics.hpp>
Public Member Functions | |
AtomicInt (int32_t init=0) | |
AtomicInt (AtomicInt const &src) | |
AtomicInt & | operator= (AtomicInt const &src) |
int32_t | get () const |
int32_t | set (int32_t newvalue) |
int32_t | changeIf (int32_t comparand, int32_t newvalue) |
int32_t | operator++ () |
int32_t | operator++ (int) |
int32_t | operator-- () |
int32_t | operator-- (int) |
int32_t | operator+= (int32_t value) |
int32_t | operator-= (int32_t value) |
< Atomic 32-bit integer
gate::AtomicInt::AtomicInt | ( | int32_t | init = 0 | ) |
Initialize atomic integer
int32_t gate::AtomicInt::changeIf | ( | int32_t | comparand, |
int32_t | newvalue ) |
Compares atomic integer with comparand
and set its to newvalue
if they match, returns previous value
int32_t gate::AtomicInt::get | ( | ) | const |
Returns value of atomic integer
int32_t gate::AtomicInt::operator++ | ( | ) |
Increments atomic integer and returns its current value
int32_t gate::AtomicInt::operator++ | ( | int | ) |
Increments atomic integer and returns its previous value
int32_t gate::AtomicInt::operator+= | ( | int32_t | value | ) |
Adds number to atomic integer and returns its updated value
int32_t gate::AtomicInt::operator-- | ( | ) |
Decrements atomic integer and returns its current value
int32_t gate::AtomicInt::operator-- | ( | int | ) |
Decrements atomic integer and returns its previous value
int32_t gate::AtomicInt::operator-= | ( | int32_t | value | ) |
Substracts number to atomic integer and returns its updated value
int32_t gate::AtomicInt::set | ( | int32_t | newvalue | ) |
Updates atomic integer to a new value and returns it previous value