![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
\inmodule QtCore More...
#include <qatomic.h>
Public Member Functions | |
constexpr | QAtomicInteger (T value=0) noexcept |
Constructs a QAtomicInteger with the given value. | |
QAtomicInteger (const QAtomicInteger &other) noexcept | |
Constructs a copy of other. | |
QAtomicInteger & | operator= (const QAtomicInteger &other) noexcept |
Assigns other to this QAtomicInteger and returns a reference to this QAtomicInteger. | |
![]() | |
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 | |
![]() | |
typedef T | Type |
typedef QAtomicOps< T > | Ops |
![]() | |
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 |
![]() | |
Ops::Type | _q_value |
\inmodule QtCore
The QAtomicInteger class provides platform-independent atomic operations on integers.
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 8-bit, 16-bit, 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 64-bit types are supported on 32-bit platforms, check the macro Q_ATOMIC_INT64_IS_SUPPORTED
.
|
inlineconstexprnoexcept |
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.