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

#include <bsls_atomic.h>

Public Member Functions

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

Detailed Description

This class is implements an atomic 64-bit integer, which supports common 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

◆ AtomicInt64() [1/2]

bsls::AtomicInt64::AtomicInt64 ( )
inline

◆ AtomicInt64() [2/2]

bsls::AtomicInt64::AtomicInt64 ( Types::Int64  value)
inline

◆ ~AtomicInt64()

bsls::AtomicInt64::~AtomicInt64 ( )
default

Member Function Documentation

◆ add()

Types::Int64 bsls::AtomicInt64::add ( Types::Int64  value)
inline

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

◆ addAcqRel()

Types::Int64 bsls::AtomicInt64::addAcqRel ( Types::Int64  value)
inline

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

◆ addRelaxed()

Types::Int64 bsls::AtomicInt64::addRelaxed ( Types::Int64  value)
inline

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

◆ load()

Types::Int64 bsls::AtomicInt64::load ( ) const
inline

◆ loadAcquire()

Types::Int64 bsls::AtomicInt64::loadAcquire ( ) const
inline

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

◆ loadRelaxed()

Types::Int64 bsls::AtomicInt64::loadRelaxed ( ) const
inline

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

◆ operator Types::Int64()

bsls::AtomicInt64::operator Types::Int64 ( ) const
inline

◆ operator++() [1/2]

Types::Int64 bsls::AtomicInt64::operator++ ( )
inline

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

◆ operator++() [2/2]

Types::Int64 bsls::AtomicInt64::operator++ ( int  )
inline

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

◆ operator+=()

Types::Int64 bsls::AtomicInt64::operator+= ( Types::Int64  value)
inline

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

◆ operator--() [1/2]

Types::Int64 bsls::AtomicInt64::operator-- ( )
inline

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

◆ operator--() [2/2]

Types::Int64 bsls::AtomicInt64::operator-- ( int  )
inline

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

◆ operator-=()

Types::Int64 bsls::AtomicInt64::operator-= ( Types::Int64  value)
inline

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

◆ operator=()

AtomicInt64 & bsls::AtomicInt64::operator= ( Types::Int64  value)
inline

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

◆ store()

void bsls::AtomicInt64::store ( Types::Int64  value)
inline

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

◆ storeRelaxed()

void bsls::AtomicInt64::storeRelaxed ( Types::Int64  value)
inline

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

◆ storeRelease()

void bsls::AtomicInt64::storeRelease ( Types::Int64  value)
inline

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

◆ subtract()

Types::Int64 bsls::AtomicInt64::subtract ( Types::Int64  value)
inline

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

◆ subtractAcqRel()

Types::Int64 bsls::AtomicInt64::subtractAcqRel ( Types::Int64  value)
inline

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

◆ subtractRelaxed()

Types::Int64 bsls::AtomicInt64::subtractRelaxed ( Types::Int64  value)
inline

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

◆ swap()

Types::Int64 bsls::AtomicInt64::swap ( Types::Int64  swapValue)
inline

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

◆ swapAcqRel()

Types::Int64 bsls::AtomicInt64::swapAcqRel ( Types::Int64  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()

Types::Int64 bsls::AtomicInt64::testAndSwap ( Types::Int64  compareValue,
Types::Int64  swapValue 
)
inline

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

◆ testAndSwapAcqRel()

Types::Int64 bsls::AtomicInt64::testAndSwapAcqRel ( Types::Int64  compareValue,
Types::Int64  swapValue 
)
inline

Compare the value of this object to the specified compareValue. If they are equal, set the value of this atomic integer to the specified swapValue, otherwise leave this value unchanged. Return the previous value of this atomic 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: