QtCore/qshareddata.h Source File
Go to the documentation of this file.
66 QSharedData &operator=(
const QSharedData &);
75 inline void detach() {
if (d && d->ref != 1) detach_helper(); }
80 inline operator T *() {
detach();
return d; }
81 inline operator const T *()
const {
return d; }
83 inline const T *
data()
const {
return d; }
100 if (old && !old->ref.deref())
111 if (old && !old->ref.deref())
116 #ifdef Q_COMPILER_RVALUE_REFS
119 {
qSwap(d, other.d);
return *
this; }
125 {
qSwap(d, other.d); }
131 void detach_helper();
145 inline T *
data()
const {
return d; }
148 inline void detach() {
if (d && d->ref != 1) detach_helper(); }
152 if(d && !d->ref.deref())
158 inline operator bool ()
const {
return d != 0; }
162 inline bool operator==(
const T *ptr)
const {
return d == ptr; }
163 inline bool operator!=(
const T *ptr)
const {
return d != ptr; }
184 if (old && !old->ref.deref())
195 if (old && !old->ref.deref())
200 #ifdef Q_COMPILER_RVALUE_REFS
203 {
qSwap(d, other.d);
return *
this; }
209 {
qSwap(d, other.d); }
215 void detach_helper();
222 {
if (d) d->ref.ref(); }
258 {
if (d) d->ref.ref(); }
286 #endif // QSHAREDDATA_H
void swap(QExplicitlySharedDataPointer &other)
const T & operator*() const
const T * constData() const
Q_INLINE_TEMPLATE void swap(QT_PREPEND_NAMESPACE(QScopedPointer)< T, Cleanup > &p1, QT_PREPEND_NAMESPACE(QScopedPointer)< T, Cleanup > &p2)
QSharedDataPointer(const QSharedDataPointer< T > &o)
QExplicitlySharedDataPointer(const QExplicitlySharedDataPointer< T > &o)
const T * constData() const
QExplicitlySharedDataPointer< T > & operator=(const QExplicitlySharedDataPointer< T > &o)
#define QT_BEGIN_NAMESPACE
GLsizei GLsizei GLenum GLenum const GLvoid * data
QSharedDataPointer< T > & operator=(const QSharedDataPointer< T > &o)
bool operator!=(const QExplicitlySharedDataPointer< T > &other) const
QSharedData(const QSharedData &)
bool operator==(const QSharedDataPointer< T > &other) const
Q_INLINE_TEMPLATE void qSwap(QSharedDataPointer< T > &p1, QSharedDataPointer< T > &p2)
bool operator!=(const T *ptr) const
QExplicitlySharedDataPointer(const QExplicitlySharedDataPointer< X > &o)
void swap(QSharedDataPointer &other)
bool operator==(const T *ptr) const
~QExplicitlySharedDataPointer()
const T * operator->() const
QSharedDataPointer & operator=(T *o)
bool operator!=(const QSharedDataPointer< T > &other) const
bool operator==(const QExplicitlySharedDataPointer< T > &other) const
QExplicitlySharedDataPointer & operator=(T *o)
QExplicitlySharedDataPointer()