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
qatomic.h File Reference

(342b37f3884e62f2097addda1aacb1d15be38bf7)

#include <QtCore/qbasicatomic.h>
+ Include dependency graph for qatomic.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  QAtomicInteger< T >
 \inmodule QtCore More...
 
class  QAtomicInt
 \inmodule QtCore More...
 
class  QAtomicPointer< T >
 \macro Q_ATOMIC_INTnn_IS_SUPPORTED More...
 

Functions

template<typename T >
QT_WARNING_POP void qAtomicAssign (T *&d, T *x)
 This is a helper for the assignment operators of implicitly shared classes.
 
template<typename T >
void qAtomicDetach (T *&d)
 This is a helper for the detach method of implicitly shared classes.
 

Function Documentation

◆ qAtomicAssign()

template<typename T >
QT_WARNING_POP void qAtomicAssign ( T *& d,
T * x )
inline

This is a helper for the assignment operators of implicitly shared classes.

Your assignment operator should look like this:

Definition at line 180 of file qatomic.h.

References d.

Referenced by QColormap::operator=(), QDBusArgument::operator=(), QDBusMessage::operator=(), QKeySequence::operator=(), QQuickGraphicsConfiguration::operator=(), QQuickGraphicsDevice::operator=(), QQuickRenderTarget::operator=(), QShader::operator=(), QShaderDescription::operator=(), QSqlDatabase::operator=(), QUrl::operator=(), and QXcbColormap::operator=().

+ Here is the caller graph for this function:

◆ qAtomicDetach()

template<typename T >
void qAtomicDetach ( T *& d)
inline

This is a helper for the detach method of implicitly shared classes.

Your private class needs a copy constructor which copies the members and sets the refcount to 1. After that, your detach function should look like this:

Definition at line 199 of file qatomic.h.

References d.

Referenced by QUrl::detach(), QShader::detach(), and QShaderDescription::detach().

+ Here is the caller graph for this function: