GATE
gate::AtomicInt Class Reference

#include <atomics.hpp>

Public Member Functions

 AtomicInt (int32_t init=0)
 
 AtomicInt (AtomicInt const &src)
 
AtomicIntoperator= (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)
 

Detailed Description

< Atomic 32-bit integer

Constructor & Destructor Documentation

◆ AtomicInt()

gate::AtomicInt::AtomicInt ( int32_t init = 0)

Initialize atomic integer

Member Function Documentation

◆ changeIf()

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

◆ get()

int32_t gate::AtomicInt::get ( ) const

Returns value of atomic integer

◆ operator++() [1/2]

int32_t gate::AtomicInt::operator++ ( )

Increments atomic integer and returns its current value

◆ operator++() [2/2]

int32_t gate::AtomicInt::operator++ ( int )

Increments atomic integer and returns its previous value

◆ operator+=()

int32_t gate::AtomicInt::operator+= ( int32_t value)

Adds number to atomic integer and returns its updated value

◆ operator--() [1/2]

int32_t gate::AtomicInt::operator-- ( )

Decrements atomic integer and returns its current value

◆ operator--() [2/2]

int32_t gate::AtomicInt::operator-- ( int )

Decrements atomic integer and returns its previous value

◆ operator-=()

int32_t gate::AtomicInt::operator-= ( int32_t value)

Substracts number to atomic integer and returns its updated value

◆ set()

int32_t gate::AtomicInt::set ( int32_t newvalue)

Updates atomic integer to a new value and returns it previous value


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