BloombergLP::bsls::AtomicOperations_DefaultPointer32

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

Synopsis

Declared in <bsls_atomicoperations_default.h>

template<class IMP>
struct AtomicOperations_DefaultPointer32;

Description

Note that AtomicOperations_DefaultPointer32 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
getPtr Atomically retrieve the value of the specified atomicPtr, providing the sequential consistency memory ordering guarantee.
getPtrAcquire Atomically retrieve the value of the specified atomicPtr, providing the acquire memory ordering guarantee.
getPtrRelaxed Atomically retrieve the value of the specified atomicPtr, without providing any memory ordering guarantees.
initPointer Initialize the specified atomicPtr and set its value to the optionally specified initialValue.
setPtr Atomically set the value of the specified atomicPtr to the specified value, providing the sequential consistency memory ordering guarantee.
setPtrRelaxed Atomically set the value of the specified atomicPtr to the specified value, without providing any memory ordering guarantees.
setPtrRelease Atomically set the value of the specified atomicPtr to the specified value, providing the release memory ordering guarantee.
swapPtr Atomically set the value of the specified atomicPtr to the specified swapValue, and return its previous value, providing the sequential consistency memory ordering guarantee.
swapPtrAcqRel Atomically set the value of the specified atomicPtr to the specified swapValue, and return its previous value, providing the acquire/release memory ordering guarantee.
testAndSwapPtr Conditionally set the value of the specified atomicPtr to the specified swapValue if and only if the value of atomicPtr equals the value of the specified compareValue, and return the initial value of atomicPtr, providing the sequential consistency memory ordering guarantee. The whole operation is performed atomically.
testAndSwapPtrAcqRel Conditionally set the value of the specified atomicPtr to the specified swapValue if and only if the value of atomicPtr equals the value of the specified compareValue, and return the initial value of atomicPtr, 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.