#include <QtCore/qatomic_arch.h>
#include <QtCore/qglobal.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 | |
| struct | QBasicAtomic |
| struct | QBasicAtomicPointer< T > |
| class | QAtomic |
| class | QAtomicPointer< T > |
Defines | |
| #define | Q_ATOMIC_INIT(a) { (a) } |
Functions | |
| template<typename T> | |
| T | qAtomicSetPtr (volatile T *ptr, T newval) |
| template<typename T> | |
| void | qAtomicAssign (T *&d, T *x) |
| template<typename T> | |
| void | qAtomicAssign (QBasicAtomicPointer< T > &d, T *x) |
| template<typename T> | |
| void | qAtomicAssign (QBasicAtomicPointer< T > &d, const QBasicAtomicPointer< T > &x) |
| template<typename T> | |
| void | qAtomicDetach (T *&d) |
| template<typename T> | |
| void | qAtomicDetach (QBasicAtomicPointer< T > &d) |
| void qAtomicAssign | ( | QBasicAtomicPointer< T > & | d, | |
| const QBasicAtomicPointer< T > & | x | |||
| ) | [inline] |
| void qAtomicAssign | ( | QBasicAtomicPointer< T > & | d, | |
| T * | x | |||
| ) | [inline] |
| 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:
MyClass &MyClass:operator=(const MyClass &other) { qAtomicAssign(d, other.d); return *this; }
Definition at line 206 of file qatomic.h.
References qAtomicSetPtr().
Referenced by QColormap::operator=(), QDateTime::operator=(), QFileInfo::operator=(), QPen::operator=(), QCursor::operator=(), QUrl::operator=(), QDBusMessage::operator=(), QSqlDatabase::operator=(), QFontMetricsF::operator=(), QKeySequence::operator=(), QFontMetrics::operator=(), QSqlQuery::operator=(), QSqlField::operator=(), QFontInfo::operator=(), QFont::operator=(), QDir::operator=(), and QSqlRecord::operator=().
00207 { 00208 x->ref.ref(); 00209 x = qAtomicSetPtr(&d, x); 00210 if (!x->ref.deref()) 00211 delete x; 00212 }
Here is the call graph for this function:

| void qAtomicDetach | ( | QBasicAtomicPointer< T > & | d | ) | [inline] |
| void qAtomicDetach | ( | T *& | d | ) | [inline] |
Definition at line 244 of file qatomic.h.
References qAtomicSetPtr(), T, and x.
Referenced by QFileInfoPrivate::detach(), QDirPrivate::detach(), QDateTime::detach(), QSqlRecord::detach(), QSqlField::detach(), QFont::detach(), QUrl::detach(), operator>>(), and QKeySequence::setKey().
00245 { 00246 if (d->ref == 1) 00247 return; 00248 T *x = new T(*d); 00249 x = qAtomicSetPtr(&d, x); 00250 if (!x->ref.deref()) 00251 delete x; 00252 }
Here is the call graph for this function:

| T qAtomicSetPtr | ( | volatile T * | ptr, | |
| T | newval | |||
| ) | [inline] |
Definition at line 148 of file qatomic.h.
References q_atomic_set_ptr().
Referenced by QVariant::detach(), QListData::detach(), QPalette::detach(), QPen::detach(), QBrush::detach(), QMap< Key, T >::detach_helper(), QLinkedList< T >::detach_helper(), QPainterPath::detach_helper(), QPicture::detach_helper(), QGLColormap::detach_helper(), QHash< Key, T >::detach_helper(), QSharedDataPointer< T >::detach_helper(), QPainterPath::ensureData_helper(), QDBusArgument::operator=(), QExplicitlySharedDataPointer< TranslationUnitData >::operator=(), QPainterPath::operator=(), QDomNamedNodeMap::operator=(), QTextDocumentFragment::operator=(), QList< T >::operator=(), QLinkedList< T >::operator=(), QPalette::operator=(), QIcon::operator=(), QBrush::operator=(), QByteArray::operator=(), QMap< Key, T >::operator=(), QX11Info::operator=(), QSharedDataPointer< QStyleSheetPaletteData >::operator=(), QString::operator=(), QVector< T >::operator=(), QHash< Key, T >::operator=(), QGLColormap::operator=(), QDomImplementation::operator=(), QDomNodeList::operator=(), QDomNode::operator=(), QImage::operator=(), qAtomicAssign(), qAtomicDetach(), QString::realloc(), QByteArray::realloc(), QVector< T >::realloc(), QByteArray::resize(), QString::resize(), QCursor::setShape(), and QList< T >::~QList().
00149 { return static_cast<T>(q_atomic_set_ptr(ptr, newval)); }
Here is the call graph for this function:

1.5.1