[#BloombergLP-bsls-AtomicInt]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsls.adoc[bsls]::AtomicInt
:relfileprefix: ../../
:mrdocs:

Atomic integer providing sequentially consistent operations by default&period;

== Synopsis

Declared in `&lt;bsls&lowbar;atomic&period;h&gt;`

[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&period; Operations on objects of this class provide the sequential consistency memory ordering guarantee unless explicitly qualified with a less strict consistency guarantee suffix (i&period;e&period;, Acquire, Release, AcqRel or Relaxed)&period;

== 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&equals;`] 
| Atomically assign the specified `value` to this object, and return a reference offering modifiable access to `this` object&period;
| xref:BloombergLP/bsls/AtomicInt/add.adoc[`add`] 
| Atomically add the specified `value` to this object and return the resulting value&period;
| xref:BloombergLP/bsls/AtomicInt/addAcqRel.adoc[`addAcqRel`] 
| Atomically add the specified `value` to this object and return the resulting value, providing the acquire&sol;release memory ordering guarantee&period;
| 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&period;
| xref:BloombergLP/bsls/AtomicInt/load.adoc[`load`] 
| Return the current value of this object&period;
| xref:BloombergLP/bsls/AtomicInt/loadAcquire.adoc[`loadAcquire`] 
| Return the current value of this object, providing the acquire memory ordering guarantee&period;
| xref:BloombergLP/bsls/AtomicInt/loadRelaxed.adoc[`loadRelaxed`] 
| Return the current value of this object, providing the relaxed memory ordering guarantee&period;
| xref:BloombergLP/bsls/AtomicInt/operator_inc-00.adoc[`operator&plus;&plus;`] 
| Increment operators
| xref:BloombergLP/bsls/AtomicInt/operator_plus_eq.adoc[`operator&plus;&equals;`] 
| Atomically add the specified `value` to this object, and return the resulting value&period;
| xref:BloombergLP/bsls/AtomicInt/operator_dec-04.adoc[`operator&hyphen;&hyphen;`] 
| Decrement operators
| xref:BloombergLP/bsls/AtomicInt/operator_minus_eq.adoc[`operator&hyphen;&equals;`] 
| Atomically subtract the specified `value` from this object, and return the resulting value&period;
| xref:BloombergLP/bsls/AtomicInt/store.adoc[`store`] 
| Atomically assign the specified `value` to this object, providing the sequential consistency memory ordering guarantee&period;
| xref:BloombergLP/bsls/AtomicInt/storeRelaxed.adoc[`storeRelaxed`] 
| Atomically assign the specified `value` to this object, providing the relaxed memory ordering guarantee&period;
| xref:BloombergLP/bsls/AtomicInt/storeRelease.adoc[`storeRelease`] 
| Atomically assign the specified `value` to this object, providing the release memory ordering guarantee&period;
| xref:BloombergLP/bsls/AtomicInt/subtract.adoc[`subtract`] 
| Atomically subtract the specified `value` to this object and return the resulting value&period;
| xref:BloombergLP/bsls/AtomicInt/subtractAcqRel.adoc[`subtractAcqRel`] 
| Atomically subtract the specified `value` to this object and return the resulting value, providing the acquire&sol;release memory ordering guarantee&period;
| 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&period;
| xref:BloombergLP/bsls/AtomicInt/swap.adoc[`swap`] 
| Atomically set the value of this object to the specified `swapValue` and return its previous value&period;
| 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&sol;release memory ordering guarantee&period;
| xref:BloombergLP/bsls/AtomicInt/testAndSwap.adoc[`testAndSwap`] 
| Conditionally swap this value if it equals `compareValue`&period;
| xref:BloombergLP/bsls/AtomicInt/testAndSwapAcqRel.adoc[`testAndSwapAcqRel`] 
| Conditionally swap this value with acquire&sol;release ordering&period;
| xref:BloombergLP/bsls/AtomicInt/2conversion.adoc[`operator int`] 
| Return the current value of this object&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
