QtBase
v6.3.1
|
The QAtomicInteger class provides platform-independent atomic operations on integers. More...
#include <qatomic.h>
Public Member Functions | |
QAtomicInteger (T value=0) noexcept | |
QAtomicInteger (const QAtomicInteger &other) noexcept | |
QAtomicInteger & | operator= (const QAtomicInteger &other) noexcept |
Public Member Functions inherited from QBasicAtomicInteger< T > | |
T | loadRelaxed () const noexcept |
void | storeRelaxed (T newValue) noexcept |
T | loadAcquire () const noexcept |
void | storeRelease (T newValue) noexcept |
operator T () const noexcept | |
T | operator= (T newValue) noexcept |
bool | ref () noexcept |
bool | deref () noexcept |
bool | testAndSetRelaxed (T expectedValue, T newValue) noexcept |
bool | testAndSetAcquire (T expectedValue, T newValue) noexcept |
bool | testAndSetRelease (T expectedValue, T newValue) noexcept |
bool | testAndSetOrdered (T expectedValue, T newValue) noexcept |
bool | testAndSetRelaxed (T expectedValue, T newValue, T ¤tValue) noexcept |
bool | testAndSetAcquire (T expectedValue, T newValue, T ¤tValue) noexcept |
bool | testAndSetRelease (T expectedValue, T newValue, T ¤tValue) noexcept |
bool | testAndSetOrdered (T expectedValue, T newValue, T ¤tValue) noexcept |
T | fetchAndStoreRelaxed (T newValue) noexcept |
T | fetchAndStoreAcquire (T newValue) noexcept |
T | fetchAndStoreRelease (T newValue) noexcept |
T | fetchAndStoreOrdered (T newValue) noexcept |
T | fetchAndAddRelaxed (T valueToAdd) noexcept |
T | fetchAndAddAcquire (T valueToAdd) noexcept |
T | fetchAndAddRelease (T valueToAdd) noexcept |
T | fetchAndAddOrdered (T valueToAdd) noexcept |
T | fetchAndSubRelaxed (T valueToAdd) noexcept |
T | fetchAndSubAcquire (T valueToAdd) noexcept |
T | fetchAndSubRelease (T valueToAdd) noexcept |
T | fetchAndSubOrdered (T valueToAdd) noexcept |
T | fetchAndAndRelaxed (T valueToAdd) noexcept |
T | fetchAndAndAcquire (T valueToAdd) noexcept |
T | fetchAndAndRelease (T valueToAdd) noexcept |
T | fetchAndAndOrdered (T valueToAdd) noexcept |
T | fetchAndOrRelaxed (T valueToAdd) noexcept |
T | fetchAndOrAcquire (T valueToAdd) noexcept |
T | fetchAndOrRelease (T valueToAdd) noexcept |
T | fetchAndOrOrdered (T valueToAdd) noexcept |
T | fetchAndXorRelaxed (T valueToAdd) noexcept |
T | fetchAndXorAcquire (T valueToAdd) noexcept |
T | fetchAndXorRelease (T valueToAdd) noexcept |
T | fetchAndXorOrdered (T valueToAdd) noexcept |
T | operator++ () noexcept |
T | operator++ (int) noexcept |
T | operator-- () noexcept |
T | operator-- (int) noexcept |
T | operator+= (T v) noexcept |
T | operator-= (T v) noexcept |
T | operator&= (T v) noexcept |
T | operator|= (T v) noexcept |
T | operator^= (T v) noexcept |
QBasicAtomicInteger ()=default | |
constexpr | QBasicAtomicInteger (T value) noexcept |
QBasicAtomicInteger (const QBasicAtomicInteger &)=delete | |
QBasicAtomicInteger & | operator= (const QBasicAtomicInteger &)=delete |
QBasicAtomicInteger & | operator= (const QBasicAtomicInteger &) volatile=delete |
Additional Inherited Members | |
Public Types inherited from QBasicAtomicInteger< T > | |
typedef T | Type |
typedef QAtomicOps< T > | Ops |
Static Public Member Functions inherited from QBasicAtomicInteger< T > | |
static constexpr bool | isReferenceCountingNative () noexcept |
static constexpr bool | isReferenceCountingWaitFree () noexcept |
static constexpr bool | isTestAndSetNative () noexcept |
static constexpr bool | isTestAndSetWaitFree () noexcept |
static constexpr bool | isFetchAndStoreNative () noexcept |
static constexpr bool | isFetchAndStoreWaitFree () noexcept |
static constexpr bool | isFetchAndAddNative () noexcept |
static constexpr bool | isFetchAndAddWaitFree () noexcept |
Public Attributes inherited from QBasicAtomicInteger< T > | |
Ops::Type | _q_value |
The QAtomicInteger class provides platform-independent atomic operations on integers.
\inmodule QtCore
For atomic operations on pointers, see the QAtomicPointer class.
An atomic operation is a complex operation that completes without interruption. The QAtomicInteger class provides atomic reference counting, test-and-set, fetch-and-store, and fetch-and-add for integers.
The template parameter T
must be a C++ integer type: \list
Of the list above, only the 32-bit- and pointer-sized instantiations are guaranteed to work on all platforms. Support for other sizes depends on the compiler and processor architecture the code is being compiled for. To test whether the other types are supported, check the macro Q_ATOMIC_INT{nn}_IS_SUPPORTED
, where {{nn}} is the number of bits desired.
|
inlinenoexcept |
Constructs a QAtomicInteger with the given value.
|
inlinenoexcept |
|
inlinenoexcept |
Assigns other to this QAtomicInteger and returns a reference to this QAtomicInteger.
Atomically stores the other value into this atomic type using a sequentially consistent memory ordering if possible; or "Release" ordering if not. This function returns a reference to this object.
Definition at line 80 of file qatomic.h.