42 #ifndef QSCOPEDPOINTER_H 43 #define QSCOPEDPOINTER_H 45 #include <QtCore/qglobal.h> 59 typedef char IsIncompleteType[
sizeof(T) ? 1 : -1 ];
60 (void)
sizeof(IsIncompleteType);
74 typedef char IsIncompleteType[
sizeof(T) ? 1 : -1 ];
75 (void)
sizeof(IsIncompleteType);
83 static inline void cleanup(
void *pointer) {
if (pointer)
qFree(pointer); }
86 template <
typename T,
typename Cleanup = QScopedPo
interDeleter<T> >
121 #if defined(Q_CC_NOKIAX86) || defined(Q_QDOC) 122 inline operator bool()
const 173 template <
class T,
class Cleanup>
179 template <
class T,
class Cleanup>
185 template <
class T,
class Cleanup>
192 template <
class T,
class Cleanup>
207 template <
typename T,
typename Cleanup = QScopedPo
interArrayDeleter<T> >
213 template <
typename D>
247 #endif // QSCOPEDPOINTER_H bool isNull() const
Returns true if this object is holding a pointer that is null.
T & operator*() const
Provides access to the scoped pointer's object.
#define QT_END_NAMESPACE
This macro expands to.
T * data() const
Returns the value of the pointer referenced by this object.
Q_CORE_EXPORT void qFree(void *ptr)
~QScopedPointer()
Destroys this QScopedPointer object.
T * take()
Returns the value of the pointer referenced by this object.
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
T * operator->() const
Provides access to the scoped pointer's object.
QScopedArrayPointer(D *p, typename QtPrivate::QScopedArrayEnsureSameType< T, D >::Type=0)
static void cleanup(void *pointer)
bool operator==(const QScopedPointer< T, Cleanup > &lhs, const QScopedPointer< T, Cleanup > &rhs)
Equality operator.
The QScopedPointer class stores a pointer to a dynamically allocated object, and deletes it upon dest...
const T & operator[](int i) const
Provides access to entry i of the scoped pointer's array of objects.
#define QT_BEGIN_NAMESPACE
This macro expands to.
bool operator!=(const QScopedPointer< T, Cleanup > &lhs, const QScopedPointer< T, Cleanup > &rhs)
Inequality operator.
QScopedArrayPointer(void *)
bool operator!() const
Returns true if the pointer referenced by this object is null, otherwise returns false.
Q_INLINE_TEMPLATE void qSwap(QScopedPointer< T, Cleanup > &p1, QScopedPointer< T, Cleanup > &p2)
#define QT_PREPEND_NAMESPACE(name)
This macro qualifies identifier with the full namespace.
#define Q_INLINE_TEMPLATE
T & operator[](int i)
Provides access to entry i of the scoped pointer's array of objects.
The QScopedArrayPointer class stores a pointer to a dynamically allocated array of objects...
void reset(T *other=0)
Deletes the existing object it is pointing to if any, and sets its pointer to other.
Q_INLINE_TEMPLATE void swap(::QScopedPointer< T, Cleanup > &p1, ::QScopedPointer< T, Cleanup > &p2)
T *QScopedPointer::* RestrictedBool
static void cleanup(T *pointer)
void swap(QScopedPointer< T, Cleanup > &other)
Swap this pointer with other.
static void cleanup(T *pointer)
QScopedPointer(T *p=0)
Constructs this QScopedPointer instance and sets its pointer to p.
QScopedArrayPointer()
Constructs a QScopedArrayPointer instance.
static bool isNull(const QVariant::Private *d)