[#BloombergLP-bsls-AtomicPointer] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsls.adoc[bsls]::AtomicPointer :relfileprefix: ../../ :mrdocs: This class implements an atomic pointer to a parameterized `TYPE`, which supports common pointer 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). == Synopsis Declared in `<bsls_atomic.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> class AtomicPointer; ---- == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bsls/AtomicPointer/2constructor-08.adoc[`AtomicPointer`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bsls/AtomicPointer/operator_assign.adoc[`operator=`] | Atomically assign the specified `value` to this object, and return a reference offering modifiable access to `this` object. | xref:BloombergLP/bsls/AtomicPointer/load.adoc[`load`] | Return the current value of this object. | xref:BloombergLP/bsls/AtomicPointer/loadAcquire.adoc[`loadAcquire`] | Return the current value of this object, providing the acquire memory ordering guarantee. | xref:BloombergLP/bsls/AtomicPointer/loadRelaxed.adoc[`loadRelaxed`] | Return the current value of this object, providing the relaxed memory ordering guarantee. | xref:BloombergLP/bsls/AtomicPointer/operator_star.adoc[`operator*`] | Return a reference to the value currently pointed to by this object. The behavior is undefined if this pointer has a value of 0. | xref:BloombergLP/bsls/AtomicPointer/operator_ptr.adoc[`operator‐>`] | Return the current value of this object. | xref:BloombergLP/bsls/AtomicPointer/store.adoc[`store`] | Atomically assign the specified `value` to this object, providing the sequential consistency memory ordering guarantee. | xref:BloombergLP/bsls/AtomicPointer/storeRelaxed.adoc[`storeRelaxed`] | Atomically assign the specified `value` to this object, providing the relaxed memory ordering guarantee. | xref:BloombergLP/bsls/AtomicPointer/storeRelease.adoc[`storeRelease`] | Atomically assign the specified `value` to this object, providing the release memory ordering guarantee. | xref:BloombergLP/bsls/AtomicPointer/swap.adoc[`swap`] | Atomically set the value of this object to the specified `swapValue` and return its previous value. | xref:BloombergLP/bsls/AtomicPointer/swapAcqRel.adoc[`swapAcqRel`] | Atomically set the value of this object to the specified `swapValue` and return its previous value, providing the acquire/release memory ordering guarantee. | xref:BloombergLP/bsls/AtomicPointer/testAndSwap.adoc[`testAndSwap`] | Compare the value of this object to the specified `compareValue`. If they are equal, set the value of this atomic pointer to the specified `swapValue`, otherwise leave this value unchanged. Return the previous value of this atomic pointer, whether or not the swap occurred. Note that the entire test‐and‐swap operation is performed atomically. | xref:BloombergLP/bsls/AtomicPointer/testAndSwapAcqRel.adoc[`testAndSwapAcqRel`] | Compare the value of this object to the specified `compareValue`. If they are equal, set the value of this atomic pointer to the specified `swapValue`, otherwise leave this value unchanged. Return the previous value of this atomic pointer, 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. | xref:BloombergLP/bsls/AtomicPointer/2conversion.adoc[`operator TYPE*`] | Return the current value of this object. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#