BloombergLP::bsls::AtomicOperations_DefaultUint

Default implementations of non-essential 32-bit unsigned atomic operations.

Synopsis

Declared in <bsls_atomicoperations_default.h>

template<class IMP>
struct AtomicOperations_DefaultUint;

Description

This class provides default implementations of non-essential atomic operations for the 32-bit unsigned integer type independent on any specific platform. It also provides prototypes for the atomic operations for the 32-bit unsigned integer type that have to be implemented separately for each specific platform. These platform-independent and platform-specific atomic operations together form a full set of atomic operations for the 32-bit unsigned integer type.

Note that AtomicOperations_DefaultUint is implemented in terms of the following atomic operations on the integer type that must be provided by the IMP template parameter. ` static int getInt(typename AtomicTypes::Int const *atomicInt); static int getIntRelaxed(typename AtomicTypes::Int const *atomicInt); static int getIntAcquire(typename AtomicTypes::Int const *atomicInt); static void setInt(typename AtomicTypes::Int *atomicInt, int value); static void setIntRelaxed(typename AtomicTypes::Int *atomicInt, int value); static void setIntRelease(typename AtomicTypes::Int *atomicInt, int value); static int swapInt(typename AtomicTypes::Int *atomicInt, int swapValue); static int swapIntAcqRel(typename AtomicTypes::Int *atomicInt, int swapValue); static int testAndSwapInt(typename AtomicTypes::Int *atomicInt, int compareValue, int swapValue); static int testAndSwapIntAcqRel(typename AtomicTypes::Int *atomicInt, int compareValue, int swapValue); `

Type Aliases

NameDescription
AtomicTypes This typedef is an alias to Atomic_TypeTraits<IMP>.

Static Member Functions

NameDescription
addUint Atomically add to the specified atomicUint the specified value, providing the sequential consistency memory ordering guarantee.
addUintAcqRel Atomically add to the specified atomicUint the specified value, providing the acquire/release memory ordering guarantee.
addUintNv Atomically add to the specified atomicUint the specified value and return the resulting value, providing the sequential consistency memory ordering guarantee.
addUintNvAcqRel Atomically add to the specified atomicUint the specified value and return the resulting value, providing the acquire/release memory ordering guarantee.
addUintNvRelaxed Atomically add to the specified atomicUint the specified value and return the resulting value, without providing any memory ordering guarantees.
addUintRelaxed Atomically add to the specified atomicUint the specified value, without providing any memory ordering guarantees.
decrementUint Atomically decrement the value of the specified atomicUint by 1, providing the sequential consistency memory ordering guarantee.
decrementUintAcqRel Atomically decrement the value of the specified atomicUint by 1, providing the acquire/release memory ordering guarantee.
decrementUintNv Atomically decrement the specified atomicUint by 1 and return the resulting value, providing the sequential consistency memory ordering guarantee.
decrementUintNvAcqRel Atomically decrement the specified atomicUint by 1 and return the resulting value, providing the acquire/release memory ordering guarantee.
getUint Atomically retrieve the value of the specified atomicUint, providing the sequential consistency memory ordering guarantee.
getUintAcquire Atomically retrieve the value of the specified atomicUint, providing the acquire memory ordering guarantee.
getUintRelaxed Atomically retrieve the value of the specified atomicUint, without providing any memory ordering guarantees.
incrementUint Atomically increment the value of the specified atomicUint by 1, providing the sequential consistency memory ordering guarantee.
incrementUintAcqRel Atomically increment the value of the specified atomicUint by 1, providing the acquire/release memory ordering guarantee.
incrementUintNv Atomically increment the specified atomicUint by 1 and return the resulting value, providing the sequential consistency memory ordering guarantee.
incrementUintNvAcqRel Atomically increment the specified atomicUint by 1 and return the resulting value, providing the acquire/release memory ordering guarantee.
initUint Initialize the specified atomicUint and set its value to the optionally specified initialValue.
setUint Atomically set the value of the specified atomicUint to the specified value, providing the sequential consistency memory ordering guarantee.
setUintRelaxed Atomically set the value of the specified atomicUint to the specified value, without providing any memory ordering guarantees.
setUintRelease Atomically set the value of the specified atomicUint to the specified value, providing the release memory ordering guarantee.
subtractUintNv Atomically subtract value from atomicUint and return the result.
subtractUintNvAcqRel Atomically subtract from the specified atomicUint the specified value and return the resulting value, providing the acquire/release memory ordering guarantee.
subtractUintNvRelaxed Atomically subtract from the specified atomicUint the specified value and return the resulting value, without providing any memory ordering guarantees.
swapUint Atomically swap atomicUint and return its previous value.
swapUintAcqRel Atomically swap atomicUint with acquire/release ordering.
testAndSwapUint Conditionally swap atomicUint if it equals compareValue.
testAndSwapUintAcqRel Conditionally swap atomicUint with acquire/release ordering.

Derived Classes

NameDescription
AtomicOperations_Default32 Default atomic operations for a generic 32-bit platform.
AtomicOperations_Default64 Default atomic operations for a generic 64-bit platform.