BloombergLP::bsls::AtomicOperations_DefaultUint

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.

Synopsis

Declared in <bsls_atomicoperations_default.h>

template<class IMP>
struct AtomicOperations_DefaultUint;

Description

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 from the specified atomicUint the specified value and return the resulting value, providing the sequential consistency memory ordering guarantee.
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 set the value of the specified atomicUint to the specified swapValue, and return its previous value, providing the sequential consistency memory ordering guarantee.
swapUintAcqRel Atomically set the value of the specified atomicUint to the specified swapValue, and return its previous value, providing the acquire/release memory ordering guarantee.
testAndSwapUint Conditionally set the value of the specified atomicUint to the specified swapValue if and only if the value of atomicUint equals the value of the specified compareValue, and return the initial value of atomicUint, providing the sequential consistency memory ordering guarantee. The whole operation is performed atomically.
testAndSwapUintAcqRel Conditionally set the value of the specified atomicUint to the specified swapValue if and only if the value of atomicInt equals the value of the specified compareValue, and return the initial value of atomicUint, providing the acquire/release memory ordering guarantee. The whole operation is performed atomically.

Derived Classes

NameDescription
AtomicOperations_Default32 This class provides default implementations of non-essential atomic operations for the 32-bit integer, 64-bit integer, the 32-bit unsigned integer, 64-bit unsigned integer and 32-bit pointer type for a generic 32-bit platform.
AtomicOperations_Default64 This class provides default implementations of non-essential atomic operations for the 32-bit integer, 64-bit integer, the 32-bit unsigned integer, 64-bit unsigned integer and 64-bit pointer type for a generic 64-bit platform.