[#BloombergLP-bsls-AtomicInt] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsls.adoc[bsls]::AtomicInt :relfileprefix: ../../ :mrdocs: Atomic integer providing sequentially consistent operations by default. == Synopsis Declared in `<bsls_atomic.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class AtomicInt; ---- == Description This class implements an atomic 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). == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bsls/AtomicInt/2constructor-0c.adoc[`AtomicInt`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bsls/AtomicInt/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/AtomicInt/add.adoc[`add`] | Atomically add the specified `value` to this object and return the resulting value. | xref:BloombergLP/bsls/AtomicInt/addAcqRel.adoc[`addAcqRel`] | Atomically add the specified `value` to this object and return the resulting value, providing the acquire/release memory ordering guarantee. | xref:BloombergLP/bsls/AtomicInt/addRelaxed.adoc[`addRelaxed`] | Atomically add the specified `value` to this object and return the resulting value, providing the relaxed memory ordering guarantee. | xref:BloombergLP/bsls/AtomicInt/load.adoc[`load`] | Return the current value of this object. | xref:BloombergLP/bsls/AtomicInt/loadAcquire.adoc[`loadAcquire`] | Return the current value of this object, providing the acquire memory ordering guarantee. | xref:BloombergLP/bsls/AtomicInt/loadRelaxed.adoc[`loadRelaxed`] | Return the current value of this object, providing the relaxed memory ordering guarantee. | xref:BloombergLP/bsls/AtomicInt/operator_inc-00.adoc[`operator++`] | Increment operators | xref:BloombergLP/bsls/AtomicInt/operator_plus_eq.adoc[`operator+=`] | Atomically add the specified `value` to this object, and return the resulting value. | xref:BloombergLP/bsls/AtomicInt/operator_dec-04.adoc[`operator‐‐`] | Decrement operators | xref:BloombergLP/bsls/AtomicInt/operator_minus_eq.adoc[`operator‐=`] | Atomically subtract the specified `value` from this object, and return the resulting value. | xref:BloombergLP/bsls/AtomicInt/store.adoc[`store`] | Atomically assign the specified `value` to this object, providing the sequential consistency memory ordering guarantee. | xref:BloombergLP/bsls/AtomicInt/storeRelaxed.adoc[`storeRelaxed`] | Atomically assign the specified `value` to this object, providing the relaxed memory ordering guarantee. | xref:BloombergLP/bsls/AtomicInt/storeRelease.adoc[`storeRelease`] | Atomically assign the specified `value` to this object, providing the release memory ordering guarantee. | xref:BloombergLP/bsls/AtomicInt/subtract.adoc[`subtract`] | Atomically subtract the specified `value` to this object and return the resulting value. | xref:BloombergLP/bsls/AtomicInt/subtractAcqRel.adoc[`subtractAcqRel`] | Atomically subtract the specified `value` to this object and return the resulting value, providing the acquire/release memory ordering guarantee. | xref:BloombergLP/bsls/AtomicInt/subtractRelaxed.adoc[`subtractRelaxed`] | Atomically subtract the specified `value` to this object and return the resulting value, providing the relaxed memory ordering guarantee. | xref:BloombergLP/bsls/AtomicInt/swap.adoc[`swap`] | Atomically set the value of this object to the specified `swapValue` and return its previous value. | xref:BloombergLP/bsls/AtomicInt/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/AtomicInt/testAndSwap.adoc[`testAndSwap`] | Conditionally swap this value if it equals `compareValue`. | xref:BloombergLP/bsls/AtomicInt/testAndSwapAcqRel.adoc[`testAndSwapAcqRel`] | Conditionally swap this value with acquire/release ordering. | xref:BloombergLP/bsls/AtomicInt/2conversion.adoc[`operator int`] | Return the current value of this object. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#