BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bsls::AtomicUint Class Reference

#include <bsls_atomic.h>

Public Member Functions

 AtomicUint ()
 Create an atomic unsigned integer object having the default value 0.
 
 AtomicUint (unsigned int value)
 
 ~AtomicUint ()=default
 
AtomicUintoperator= (unsigned int value)
 
unsigned int operator+= (unsigned int value)
 
unsigned int operator-= (unsigned int value)
 
unsigned int operator++ ()
 
unsigned int operator++ (int)
 
unsigned int operator-- ()
 
unsigned int operator-- (int)
 
unsigned int add (unsigned int value)
 
unsigned int addAcqRel (unsigned int value)
 
unsigned int addRelaxed (unsigned int value)
 
void store (unsigned int value)
 
void storeRelaxed (unsigned int value)
 
void storeRelease (unsigned int value)
 
unsigned int subtract (unsigned int value)
 
unsigned int subtractAcqRel (unsigned int value)
 
unsigned int subtractRelaxed (unsigned int value)
 
unsigned int swap (unsigned int swapValue)
 
unsigned int swapAcqRel (unsigned int swapValue)
 
unsigned int testAndSwap (unsigned int compareValue, unsigned int swapValue)
 
unsigned int testAndSwapAcqRel (unsigned int compareValue, unsigned int swapValue)
 
 operator unsigned int () const
 Return the current value of this object.
 
unsigned int load () const
 Return the current value of this object.
 
unsigned int loadAcquire () const
 
unsigned int loadRelaxed () const
 

Detailed Description

This class implements an atomic unsigned integer, which supports common unsigned integer operations in a way that is guaranteed to be atomic. Operations on objects of this class provide the sequential consistency memory ordering guarantee unless explicitly qualified with a less strict consistency guarantee suffix (i.e., Acquire, Release, AcqRel or Relaxed).

See bsls_atomic

Constructor & Destructor Documentation

◆ AtomicUint() [1/2]

bsls::AtomicUint::AtomicUint ( )
inline

◆ AtomicUint() [2/2]

bsls::AtomicUint::AtomicUint ( unsigned int  value)
inline

Create an atomic unsigned integer object having the specified value.

◆ ~AtomicUint()

bsls::AtomicUint::~AtomicUint ( )
default

Member Function Documentation

◆ add()

unsigned int bsls::AtomicUint::add ( unsigned int  value)
inline

Atomically add the specified value to this object and return the resulting value.

◆ addAcqRel()

unsigned int bsls::AtomicUint::addAcqRel ( unsigned int  value)
inline

Atomically add the specified value to this object and return the resulting value, providing the acquire/release memory ordering guarantee.

◆ addRelaxed()

unsigned int bsls::AtomicUint::addRelaxed ( unsigned int  value)
inline

Atomically add the specified value to this object and return the resulting value, providing the relaxed memory ordering guarantee.

◆ load()

unsigned int bsls::AtomicUint::load ( ) const
inline

◆ loadAcquire()

unsigned int bsls::AtomicUint::loadAcquire ( ) const
inline

Return the current value of this object, providing the acquire memory ordering guarantee.

◆ loadRelaxed()

unsigned int bsls::AtomicUint::loadRelaxed ( ) const
inline

Return the current value of this object, providing the relaxed memory ordering guarantee.

◆ operator unsigned int()

bsls::AtomicUint::operator unsigned int ( ) const
inline

◆ operator++() [1/2]

unsigned int bsls::AtomicUint::operator++ ( )
inline

Atomically increment the value of this object by 1 and return the resulting value.

◆ operator++() [2/2]

unsigned int bsls::AtomicUint::operator++ ( int  )
inline

Atomically increment the value of this object by 1 and return the value prior to being incremented.

◆ operator+=()

unsigned int bsls::AtomicUint::operator+= ( unsigned int  value)
inline

Atomically add the specified value to this object, and return the resulting value.

◆ operator--() [1/2]

unsigned int bsls::AtomicUint::operator-- ( )
inline

Atomically decrement the value of this object by 1 and return the resulting value.

◆ operator--() [2/2]

unsigned int bsls::AtomicUint::operator-- ( int  )
inline

Atomically decrement the value of this object by 1 and return the value prior to being decremented.

◆ operator-=()

unsigned int bsls::AtomicUint::operator-= ( unsigned int  value)
inline

Atomically subtract the specified value from this object, and return the resulting value.

◆ operator=()

AtomicUint & bsls::AtomicUint::operator= ( unsigned int  value)
inline

Atomically assign the specified value to this object, and return a reference offering modifiable access to this object.

◆ store()

void bsls::AtomicUint::store ( unsigned int  value)
inline

Atomically assign the specified value to this object, providing the sequential consistency memory ordering guarantee.

◆ storeRelaxed()

void bsls::AtomicUint::storeRelaxed ( unsigned int  value)
inline

Atomically assign the specified value to this object, providing the relaxed memory ordering guarantee.

◆ storeRelease()

void bsls::AtomicUint::storeRelease ( unsigned int  value)
inline

Atomically assign the specified value to this object, providing the release memory ordering guarantee.

◆ subtract()

unsigned int bsls::AtomicUint::subtract ( unsigned int  value)
inline

Atomically subtract the specified value from this object and return the resulting value.

◆ subtractAcqRel()

unsigned int bsls::AtomicUint::subtractAcqRel ( unsigned int  value)
inline

Atomically subtract the specified value from this object and return the resulting value, providing the acquire/release memory ordering guarantee.

◆ subtractRelaxed()

unsigned int bsls::AtomicUint::subtractRelaxed ( unsigned int  value)
inline

Atomically subtract the specified value from this object and return the resulting value, providing the relaxed memory ordering guarantee.

◆ swap()

unsigned int bsls::AtomicUint::swap ( unsigned int  swapValue)
inline

Atomically set the value of this object to the specified swapValue and return its previous value.

◆ swapAcqRel()

unsigned int bsls::AtomicUint::swapAcqRel ( unsigned int  swapValue)
inline

Atomically set the value of this object to the specified swapValue and return its previous value, providing the acquire/release memory ordering guarantee.

◆ testAndSwap()

unsigned int bsls::AtomicUint::testAndSwap ( unsigned int  compareValue,
unsigned int  swapValue 
)
inline

Compare the value of this object to the specified compareValue. If they are equal, set the value of this atomic unsigned integer to the specified swapValue, otherwise leave this value unchanged. Return the previous value of this atomic unsigned integer, whether or not the swap occurred. Note that the entire test-and-swap operation is performed atomically.

◆ testAndSwapAcqRel()

unsigned int bsls::AtomicUint::testAndSwapAcqRel ( unsigned int  compareValue,
unsigned int  swapValue 
)
inline

Compare the value of this object to the specified compareValue. If they are equal, set the value of this atomic unsigned integer to the specified swapValue, otherwise leave this value unchanged. Return the previous value of this atomic unsigned integer, whether or not the swap occurred. Note that the entire test-and-swap operation is performed atomically and it provides the acquire/release memory ordering guarantee.


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