Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qshareddata.h File Reference
#include <QtCore/qglobal.h>
#include <QtCore/qatomic.h>
#include <QtCore/qhashfunctions.h>
#include <functional>
+ Include dependency graph for qshareddata.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  QSharedData
 \inmodule QtCore More...
 
class  QAdoptSharedDataTag
 \inmodule QtCore \threadsafe More...
 
class  QSharedDataPointer< T >
 \inmodule QtCore More...
 
class  QExplicitlySharedDataPointer< T >
 \inmodule QtCore More...
 

Macros

#define DECLARE_COMPARE_SET(T1, A1, T2, A2)
 
#define QT_DECLARE_QSDP_SPECIALIZATION_DTOR(Class)    template<> QSharedDataPointer<Class>::~QSharedDataPointer();
 
#define QT_DECLARE_QSDP_SPECIALIZATION_DTOR_WITH_EXPORT(Class, ExportMacro)    template<> ExportMacro QSharedDataPointer<Class>::~QSharedDataPointer();
 
#define QT_DEFINE_QSDP_SPECIALIZATION_DTOR(Class)
 
#define QT_DECLARE_QESDP_SPECIALIZATION_DTOR(Class)    template<> QExplicitlySharedDataPointer<Class>::~QExplicitlySharedDataPointer();
 
#define QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT(Class, ExportMacro)    template<> ExportMacro QExplicitlySharedDataPointer<Class>::~QExplicitlySharedDataPointer();
 
#define QT_DEFINE_QESDP_SPECIALIZATION_DTOR(Class)
 

Functions

template<typename T >
void swap (QSharedDataPointer< T > &p1, QSharedDataPointer< T > &p2) noexcept
 
template<typename T >
void swap (QExplicitlySharedDataPointer< T > &p1, QExplicitlySharedDataPointer< T > &p2) noexcept
 
template<typename T >
size_t qHash (const QSharedDataPointer< T > &ptr, size_t seed=0) noexcept
 
template<typename T >
size_t qHash (const QExplicitlySharedDataPointer< T > &ptr, size_t seed=0) noexcept
 
template<typename T >
 Q_DECLARE_TYPEINFO_BODY (QSharedDataPointer< T >, Q_RELOCATABLE_TYPE)
 
template<typename T >
 Q_DECLARE_TYPEINFO_BODY (QExplicitlySharedDataPointer< T >, Q_RELOCATABLE_TYPE)
 

Macro Definition Documentation

◆ DECLARE_COMPARE_SET

#define DECLARE_COMPARE_SET (   T1,
  A1,
  T2,
  A2 
)
Value:
friend bool operator<(T1, T2) noexcept \
{ return std::less<T*>{}(A1, A2); } \
friend bool operator<=(T1, T2) noexcept \
{ return !std::less<T*>{}(A2, A1); } \
friend bool operator>(T1, T2) noexcept \
{ return std::less<T*>{}(A2, A1); } \
friend bool operator>=(T1, T2) noexcept \
{ return !std::less<T*>{}(A1, A2); } \
friend bool operator==(T1, T2) noexcept \
{ return A1 == A2; } \
friend bool operator!=(T1, T2) noexcept \
{ return A1 != A2; } \
constexpr bool operator!=(const timespec &t1, const timespec &t2)
bool operator>(const QPoint &a, const QPoint &b)
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
Definition qrandom.cpp:1219
static bool operator<(const QSettingsIniKey &k1, const QSettingsIniKey &k2)
bool operator<=(const QUuid &lhs, const QUuid &rhs) noexcept
Definition quuid.h:272
bool operator>=(const QUuid &lhs, const QUuid &rhs) noexcept
Definition quuid.h:274

Definition at line 99 of file qshareddata.h.

◆ QT_DECLARE_QESDP_SPECIALIZATION_DTOR

#define QT_DECLARE_QESDP_SPECIALIZATION_DTOR (   Class)     template<> QExplicitlySharedDataPointer<Class>::~QExplicitlySharedDataPointer();

Definition at line 287 of file qshareddata.h.

◆ QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT

#define QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT (   Class,
  ExportMacro 
)     template<> ExportMacro QExplicitlySharedDataPointer<Class>::~QExplicitlySharedDataPointer();

Definition at line 290 of file qshareddata.h.

◆ QT_DECLARE_QSDP_SPECIALIZATION_DTOR

#define QT_DECLARE_QSDP_SPECIALIZATION_DTOR (   Class)     template<> QSharedDataPointer<Class>::~QSharedDataPointer();

Definition at line 274 of file qshareddata.h.

◆ QT_DECLARE_QSDP_SPECIALIZATION_DTOR_WITH_EXPORT

#define QT_DECLARE_QSDP_SPECIALIZATION_DTOR_WITH_EXPORT (   Class,
  ExportMacro 
)     template<> ExportMacro QSharedDataPointer<Class>::~QSharedDataPointer();

Definition at line 277 of file qshareddata.h.

◆ QT_DEFINE_QESDP_SPECIALIZATION_DTOR

#define QT_DEFINE_QESDP_SPECIALIZATION_DTOR (   Class)
Value:
{ \
if (d && !d->ref.deref()) \
delete d; \
}
~QExplicitlySharedDataPointer()
Decrements the reference count of the shared data object.

Definition at line 293 of file qshareddata.h.

◆ QT_DEFINE_QSDP_SPECIALIZATION_DTOR

#define QT_DEFINE_QSDP_SPECIALIZATION_DTOR (   Class)
Value:
{ \
if (d && !d->ref.deref()) \
delete d; \
}
~QSharedDataPointer()
Decrements the reference count of the shared data object.
Definition qshareddata.h:56

Definition at line 280 of file qshareddata.h.

Function Documentation

◆ Q_DECLARE_TYPEINFO_BODY() [1/2]

template<typename T >
Q_DECLARE_TYPEINFO_BODY ( QExplicitlySharedDataPointer< T >  ,
Q_RELOCATABLE_TYPE   
)

◆ Q_DECLARE_TYPEINFO_BODY() [2/2]

template<typename T >
Q_DECLARE_TYPEINFO_BODY ( QSharedDataPointer< T >  ,
Q_RELOCATABLE_TYPE   
)

◆ qHash() [1/2]

template<typename T >
size_t qHash ( const QExplicitlySharedDataPointer< T > &  ptr,
size_t  seed = 0 
)
noexcept

Definition at line 266 of file qshareddata.h.

References ptr(), qHash(), and seed.

+ Here is the call graph for this function:

◆ qHash() [2/2]

template<typename T >
size_t qHash ( const QSharedDataPointer< T > &  ptr,
size_t  seed = 0 
)
noexcept

Definition at line 261 of file qshareddata.h.

References ptr(), qHash(), and seed.

Referenced by qHash(), and qHash().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swap() [1/2]

template<typename T >
void swap ( QExplicitlySharedDataPointer< T > &  p1,
QExplicitlySharedDataPointer< T > &  p2 
)
noexcept

Definition at line 257 of file qshareddata.h.

References p1, p2, and QPixmap::swap().

+ Here is the call graph for this function:

◆ swap() [2/2]

template<typename T >
void swap ( QSharedDataPointer< T > &  p1,
QSharedDataPointer< T > &  p2 
)
noexcept

Definition at line 253 of file qshareddata.h.

References p1, p2, and QPixmap::swap().

+ Here is the call graph for this function: