Qt 4.8
Classes | Namespaces | Functions
qscopedpointer.h File Reference
#include <QtCore/qglobal.h>

Go to the source code of this file.

Classes

class  QScopedArrayPointer< T, Cleanup >
 The QScopedArrayPointer class stores a pointer to a dynamically allocated array of objects, and deletes it upon destruction. More...
 
class  QScopedPointer< T, Cleanup >
 The QScopedPointer class stores a pointer to a dynamically allocated object, and deletes it upon destruction. More...
 
struct  QScopedPointerArrayDeleter< T >
 
struct  QScopedPointerDeleter< T >
 
struct  QScopedPointerPodDeleter
 
struct  QtPrivate::QScopedArrayEnsureSameType< X, Y >
 
struct  QtPrivate::QScopedArrayEnsureSameType< const X, X >
 
struct  QtPrivate::QScopedArrayEnsureSameType< X, X >
 

Namespaces

 QtPrivate
 

Functions

template<class T , class Cleanup >
bool operator!= (const QScopedPointer< T, Cleanup > &lhs, const QScopedPointer< T, Cleanup > &rhs)
 Inequality operator. More...
 
template<class T , class Cleanup >
bool operator== (const QScopedPointer< T, Cleanup > &lhs, const QScopedPointer< T, Cleanup > &rhs)
 Equality operator. More...
 
template<class T , class Cleanup >
Q_INLINE_TEMPLATE void qSwap (QScopedPointer< T, Cleanup > &p1, QScopedPointer< T, Cleanup > &p2)
 
template<class T , class Cleanup >
Q_INLINE_TEMPLATE void std::swap (::QScopedPointer< T, Cleanup > &p1, ::QScopedPointer< T, Cleanup > &p2)
 

Function Documentation

◆ operator!=()

template<class T , class Cleanup >
bool operator!= ( const QScopedPointer< T, Cleanup > &  lhs,
const QScopedPointer< T, Cleanup > &  rhs 
)
inline

Inequality operator.

Returns true if the scoped pointers lhs and rhs are not pointing to the same object. Otherwise returns false.

Definition at line 180 of file qscopedpointer.h.

181 {
182  return lhs.data() != rhs.data();
183 }
T * data() const
Returns the value of the pointer referenced by this object.

◆ operator==()

template<class T , class Cleanup >
bool operator== ( const QScopedPointer< T, Cleanup > &  lhs,
const QScopedPointer< T, Cleanup > &  rhs 
)
inline

Equality operator.

Returns true if the scoped pointers lhs and rhs are pointing to the same object. Otherwise returns false.

Definition at line 174 of file qscopedpointer.h.

175 {
176  return lhs.data() == rhs.data();
177 }
T * data() const
Returns the value of the pointer referenced by this object.

◆ qSwap()

template<class T , class Cleanup >
Q_INLINE_TEMPLATE void qSwap ( QScopedPointer< T, Cleanup > &  p1,
QScopedPointer< T, Cleanup > &  p2 
)

Definition at line 186 of file qscopedpointer.h.

Referenced by QScopedPointer< QXmlResultItemsPrivate >::swap().

187 { p1.swap(p2); }
void swap(QScopedPointer< T, Cleanup > &other)
Swap this pointer with other.

◆ swap()

template<class T , class Cleanup >
Q_INLINE_TEMPLATE void std::swap ( ::QScopedPointer< T, Cleanup > &  p1,
::QScopedPointer< T, Cleanup > &  p2 
)

Definition at line 193 of file qscopedpointer.h.

Referenced by std::swap().

194  { p1.swap(p2); }
void swap(QScopedPointer< T, Cleanup > &other)
Swap this pointer with other.