Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QAtomicPointer< T > Class Template Reference

\macro Q_ATOMIC_INTnn_IS_SUPPORTED More...

#include <qatomic.h>

+ Inheritance diagram for QAtomicPointer< T >:
+ Collaboration diagram for QAtomicPointer< T >:

Public Member Functions

constexpr QAtomicPointer (T *value=nullptr) noexcept
 Constructs a QAtomicPointer with the given value.
 
 QAtomicPointer (const QAtomicPointer< T > &other) noexcept
 Constructs a copy of other.
 
QAtomicPointer< T > & operator= (const QAtomicPointer< T > &other) noexcept
 Assigns other to this QAtomicPointer and returns a reference to this QAtomicPointer.
 
- Public Member Functions inherited from QBasicAtomicPointer< T >
Type loadRelaxed () const noexcept
 
void storeRelaxed (Type newValue) noexcept
 
 operator Type () const noexcept
 
Type operator= (Type newValue) noexcept
 
QBasicAtomicPointeroperator= (const QBasicAtomicPointer &)=delete
 
QBasicAtomicPointeroperator= (const QBasicAtomicPointer &) volatile=delete
 
Type loadAcquire () const noexcept
 
void storeRelease (Type newValue) noexcept
 
bool testAndSetRelaxed (Type expectedValue, Type newValue) noexcept
 
bool testAndSetRelaxed (Type expectedValue, Type newValue, Type &currentValue) noexcept
 
bool testAndSetAcquire (Type expectedValue, Type newValue) noexcept
 
bool testAndSetAcquire (Type expectedValue, Type newValue, Type &currentValue) noexcept
 
bool testAndSetRelease (Type expectedValue, Type newValue) noexcept
 
bool testAndSetRelease (Type expectedValue, Type newValue, Type &currentValue) noexcept
 
bool testAndSetOrdered (Type expectedValue, Type newValue) noexcept
 
bool testAndSetOrdered (Type expectedValue, Type newValue, Type &currentValue) noexcept
 
Type fetchAndStoreRelaxed (Type newValue) noexcept
 
Type fetchAndStoreAcquire (Type newValue) noexcept
 
Type fetchAndStoreRelease (Type newValue) noexcept
 
Type fetchAndStoreOrdered (Type newValue) noexcept
 
Type fetchAndAddRelaxed (qptrdiff valueToAdd) noexcept
 
Type fetchAndAddAcquire (qptrdiff valueToAdd) noexcept
 
Type fetchAndAddRelease (qptrdiff valueToAdd) noexcept
 
Type fetchAndAddOrdered (qptrdiff valueToAdd) noexcept
 
Type fetchAndSubRelaxed (qptrdiff valueToAdd) noexcept
 
Type fetchAndSubAcquire (qptrdiff valueToAdd) noexcept
 
Type fetchAndSubRelease (qptrdiff valueToAdd) noexcept
 
Type fetchAndSubOrdered (qptrdiff valueToAdd) noexcept
 
Type operator++ () noexcept
 
Type operator++ (int) noexcept
 
Type operator-- () noexcept
 
Type operator-- (int) noexcept
 
Type operator+= (qptrdiff valueToAdd) noexcept
 
Type operator-= (qptrdiff valueToSub) noexcept
 
 QBasicAtomicPointer ()=default
 
constexpr QBasicAtomicPointer (Type value) noexcept
 
 QBasicAtomicPointer (const QBasicAtomicPointer &)=delete
 

Related Symbols

(Note that these are not member symbols.)

 QT_BEGIN_NAMESPACE
 \macro Q_ATOMIC_POINTER_TEST_AND_SET_IS_ALWAYS_NATIVE
 

Additional Inherited Members

- Public Types inherited from QBasicAtomicPointer< T >
typedef T * Type
 
typedef QAtomicOps< TypeOps
 
typedef Ops::Type AtomicType
 
- Static Public Member Functions inherited from QBasicAtomicPointer< T >
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 QBasicAtomicPointer< T >
AtomicType _q_value
 

Detailed Description

template<typename T>
class QAtomicPointer< T >

\macro Q_ATOMIC_INTnn_IS_SUPPORTED

This macro is defined if atomic integers of size {nn} (in bits) are supported in this compiler / architecture combination.

{nn} is the size of the integer, in bits (8, 16, 32 or 64).

The following macros always defined:

\list

  • Q_ATOMIC_INT8_IS_SUPPORTED
  • Q_ATOMIC_INT16_IS_SUPPORTED
  • Q_ATOMIC_INT32_IS_SUPPORTED \endlist

\macro Q_ATOMIC_INTnn_REFERENCE_COUNTING_IS_ALWAYS_NATIVE

This macro is defined if and only if all generations of your processor support atomic reference counting.

{nn} is the size of the integer, in bits (8, 16, 32 or 64).

\macro Q_ATOMIC_INTnn_REFERENCE_COUNTING_IS_SOMETIMES_NATIVE

This macro is defined when only certain generations of the processor support atomic reference counting. Use the QAtomicInteger<T>::isReferenceCountingNative() function to check what your processor supports.

{nn} is the size of the integer, in bits (8, 16, 32 or 64).

\macro Q_ATOMIC_INTnn_REFERENCE_COUNTING_IS_NOT_NATIVE

This macro is defined when the hardware does not support atomic reference counting.

{nn} is the size of the integer, in bits (8, 16, 32 or 64).

\macro Q_ATOMIC_INTnn_REFERENCE_COUNTING_IS_WAIT_FREE

This macro is defined together with Q_ATOMIC_INTnn_REFERENCE_COUNTING_IS_ALWAYS_NATIVE to indicate that the reference counting is wait-free.

{nn} is the size of the integer, in bits (8, 16, 32 or 64).

\macro Q_ATOMIC_INTnn_TEST_AND_SET_IS_ALWAYS_NATIVE

This macro is defined if and only if your processor supports atomic test-and-set on integers.

{nn} is the size of the integer, in bits (8, 16, 32 or 64).

\macro Q_ATOMIC_INTnn_TEST_AND_SET_IS_SOMETIMES_NATIVE

This macro is defined when only certain generations of the processor support atomic test-and-set on integers. Use the QAtomicInteger<T>::isTestAndSetNative() function to check what your processor supports.

{nn} is the size of the integer, in bits (8, 16, 32 or 64).

\macro Q_ATOMIC_INTnn_TEST_AND_SET_IS_NOT_NATIVE

This macro is defined when the hardware does not support atomic test-and-set on integers.

{nn} is the size of the integer, in bits (8, 16, 32 or 64).

\macro Q_ATOMIC_INTnn_TEST_AND_SET_IS_WAIT_FREE

This macro is defined together with Q_ATOMIC_INTnn_TEST_AND_SET_IS_ALWAYS_NATIVE to indicate that the atomic test-and-set on integers is wait-free.

{nn} is the size of the integer, in bits (8, 16, 32 or 64).

\macro Q_ATOMIC_INTnn_FETCH_AND_STORE_IS_ALWAYS_NATIVE

This macro is defined if and only if your processor supports atomic fetch-and-store on integers.

{nn} is the size of the integer, in bits (8, 16, 32 or 64).

\macro Q_ATOMIC_INTnn_FETCH_AND_STORE_IS_SOMETIMES_NATIVE

This macro is defined when only certain generations of the processor support atomic fetch-and-store on integers. Use the QAtomicInteger<T>::isFetchAndStoreNative() function to check what your processor supports.

{nn} is the size of the integer, in bits (8, 16, 32 or 64).

\macro Q_ATOMIC_INTnn_FETCH_AND_STORE_IS_NOT_NATIVE

This macro is defined when the hardware does not support atomic fetch-and-store on integers.

{nn} is the size of the integer, in bits (8, 16, 32 or 64).

\macro Q_ATOMIC_INTnn_FETCH_AND_STORE_IS_WAIT_FREE

This macro is defined together with Q_ATOMIC_INTnn_FETCH_AND_STORE_IS_ALWAYS_NATIVE to indicate that the atomic fetch-and-store on integers is wait-free.

{nn} is the size of the integer, in bits (8, 16, 32 or 64).

\macro Q_ATOMIC_INTnn_FETCH_AND_ADD_IS_ALWAYS_NATIVE

This macro is defined if and only if your processor supports atomic fetch-and-add on integers.

{nn} is the size of the integer, in bits (8, 16, 32 or 64).

\macro Q_ATOMIC_INTnn_FETCH_AND_ADD_IS_SOMETIMES_NATIVE

This macro is defined when only certain generations of the processor support atomic fetch-and-add on integers. Use the QAtomicInteger<T>::isFetchAndAddNative() function to check what your processor supports.

{nn} is the size of the integer, in bits (8, 16, 32 or 64).

\macro Q_ATOMIC_INTnn_FETCH_AND_ADD_IS_NOT_NATIVE

This macro is defined when the hardware does not support atomic fetch-and-add on integers.

{nn} is the size of the integer, in bits (8, 16, 32 or 64).

\macro Q_ATOMIC_INTnn_FETCH_AND_ADD_IS_WAIT_FREE

This macro is defined together with Q_ATOMIC_INTnn_FETCH_AND_ADD_IS_ALWAYS_NATIVE to indicate that the atomic fetch-and-add on integers is wait-free.

{nn} is the size of the integer, in bits (8, 16, 32 or 64).

\inmodule QtCore

The QAtomicPointer class is a template class that provides platform-independent atomic operations on pointers.

Since
4.4

For atomic operations on integers, see the QAtomicInteger class.

An atomic operation is a complex operation that completes without interruption. The QAtomicPointer class provides atomic test-and-set, fetch-and-store, and fetch-and-add for pointers.

Definition at line 122 of file qatomic.h.

Constructor & Destructor Documentation

◆ QAtomicPointer() [1/2]

template<typename T >
template< typename T > QAtomicPointer< T >::QAtomicPointer ( T * value = nullptr)
inlineconstexprnoexcept

Constructs a QAtomicPointer with the given value.

Definition at line 125 of file qatomic.h.

◆ QAtomicPointer() [2/2]

template<typename T >
template< typename T > QAtomicPointer< T >::QAtomicPointer ( const QAtomicPointer< T > & other)
inlinenoexcept

Constructs a copy of other.

Definition at line 127 of file qatomic.h.

References other(), and QBasicAtomicPointer< T >::storeRelease().

+ Here is the call graph for this function:

Member Function Documentation

◆ operator=()

template<typename T >
template< typename T > QAtomicPointer & QAtomicPointer< T >::operator= ( const QAtomicPointer< T > & other)
inlinenoexcept

Assigns other to this QAtomicPointer and returns a reference to this QAtomicPointer.

Definition at line 133 of file qatomic.h.

References other(), and QBasicAtomicPointer< T >::storeRelease().

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ QT_BEGIN_NAMESPACE

template<typename T >
QAtomicPointer< T >::QT_BEGIN_NAMESPACE
related

\macro Q_ATOMIC_POINTER_TEST_AND_SET_IS_ALWAYS_NATIVE

This macro is defined if and only if your processor supports atomic test-and-set on pointers.

\macro Q_ATOMIC_POINTER_TEST_AND_SET_IS_SOMETIMES_NATIVE

This macro is defined when only certain generations of the processor support atomic test-and-set on pointers. Use the QAtomicPointer::isTestAndSetNative() function to check what your processor supports.

\macro Q_ATOMIC_POINTER_TEST_AND_SET_IS_NOT_NATIVE

This macro is defined when the hardware does not support atomic test-and-set on pointers.

\macro Q_ATOMIC_POINTER_TEST_AND_SET_IS_WAIT_FREE

This macro is defined together with Q_ATOMIC_POINTER_TEST_AND_SET_IS_ALWAYS_NATIVE to indicate that the atomic test-and-set on pointers is wait-free.

\macro Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_ALWAYS_NATIVE

This macro is defined if and only if your processor supports atomic fetch-and-store on pointers.

\macro Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_SOMETIMES_NATIVE

This macro is defined when only certain generations of the processor support atomic fetch-and-store on pointers. Use the QAtomicPointer::isFetchAndStoreNative() function to check what your processor supports.

\macro Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_NOT_NATIVE

This macro is defined when the hardware does not support atomic fetch-and-store on pointers.

\macro Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_WAIT_FREE

This macro is defined together with Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_ALWAYS_NATIVE to indicate that the atomic fetch-and-store on pointers is wait-free.

\macro Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_ALWAYS_NATIVE

This macro is defined if and only if your processor supports atomic fetch-and-add on pointers.

\macro Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_SOMETIMES_NATIVE

This macro is defined when only certain generations of the processor support atomic fetch-and-add on pointers. Use the QAtomicPointer::isFetchAndAddNative() function to check what your processor supports.

\macro Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_NOT_NATIVE

This macro is defined when the hardware does not support atomic fetch-and-add on pointers.

\macro Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_WAIT_FREE

This macro is defined together with Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_ALWAYS_NATIVE to indicate that the atomic fetch-and-add on pointers is wait-free.

Definition at line 1762 of file qatomic.cpp.


The documentation for this class was generated from the following files: