Qt 4.8
Public Functions | List of all members
QScopedSharedPointer< T > Class Template Reference

#include <qscopedpointer_p.h>

Inheritance diagram for QScopedSharedPointer< T >:
QCustomScopedPointer< T, QScopedPointerSharedDeleter< T > > QScopedPointer< T, QScopedPointerSharedDeleter< T > >

Public Functions

void assign (T *other)
 
void detach ()
 
bool operator!= (const QScopedSharedPointer< T > &other) const
 
bool operator== (const QScopedSharedPointer< T > &other) const
 
 QScopedSharedPointer (T *p=0)
 
- Public Functions inherited from QCustomScopedPointer< T, QScopedPointerSharedDeleter< T > >
T *& data_ptr ()
 
bool operator!= (const QCustomScopedPointer< T, QScopedPointerSharedDeleter< T > > &other) const
 
bool operator== (const QCustomScopedPointer< T, QScopedPointerSharedDeleter< T > > &other) const
 
 QCustomScopedPointer (T *p=0)
 
- Public Functions inherited from QScopedPointer< T, QScopedPointerSharedDeleter< T > >
T * data () const
 Returns the value of the pointer referenced by this object. More...
 
bool isNull () const
 Returns true if this object is holding a pointer that is null. More...
 
 operator bool () const
 Returns true if this object is not null. More...
 
bool operator! () const
 Returns true if the pointer referenced by this object is null, otherwise returns false. More...
 
T & operator* () const
 Provides access to the scoped pointer's object. More...
 
T * operator-> () const
 Provides access to the scoped pointer's object. More...
 
 QScopedPointer (T *p=0)
 Constructs this QScopedPointer instance and sets its pointer to p. More...
 
void reset (T *other=0)
 Deletes the existing object it is pointing to if any, and sets its pointer to other. More...
 
void swap (QScopedPointer< T, QScopedPointerSharedDeleter< T > > &other)
 Swap this pointer with other. More...
 
T * take ()
 Returns the value of the pointer referenced by this object. More...
 
 ~QScopedPointer ()
 Destroys this QScopedPointer object. More...
 

Additional Inherited Members

- Public Types inherited from QScopedPointer< T, QScopedPointerSharedDeleter< T > >
typedef T * pointer
 
- Protected Variables inherited from QScopedPointer< T, QScopedPointerSharedDeleter< T > >
T * d
 

Detailed Description

template<typename T>
class QScopedSharedPointer< T >

Definition at line 109 of file qscopedpointer_p.h.

Constructors and Destructors

◆ QScopedSharedPointer()

template<typename T>
QScopedSharedPointer< T >::QScopedSharedPointer ( T *  p = 0)
inlineexplicit

Functions

◆ assign()

template<typename T>
void QScopedSharedPointer< T >::assign ( T *  other)
inline

Definition at line 122 of file qscopedpointer_p.h.

Referenced by QScriptValueProperty::operator=(), QScriptDebuggerValueProperty::operator=(), QScriptDebuggerConsoleCommandGroupData::operator=(), QScriptScriptData::operator=(), and QScriptDebuggerValue::operator=().

123  {
124  if (this->d == other)
125  return;
126  if (other)
127  other->ref.ref();
128  T *oldD = this->d;
129  this->d = other;
131  }

◆ detach()

template<typename T>
void QScopedSharedPointer< T >::detach ( )
inline

Definition at line 117 of file qscopedpointer_p.h.

118  {
119  qAtomicDetach(this->d);
120  }
void qAtomicDetach(T *&d)
This is a helper for the detach method of implicitly shared classes.
Definition: qatomic.h:214

◆ operator!=()

template<typename T>
bool QScopedSharedPointer< T >::operator!= ( const QScopedSharedPointer< T > &  other) const
inline

Definition at line 138 of file qscopedpointer_p.h.

139  {
140  return this->d != other.d;
141  }

◆ operator==()

template<typename T>
bool QScopedSharedPointer< T >::operator== ( const QScopedSharedPointer< T > &  other) const
inline

Definition at line 133 of file qscopedpointer_p.h.

134  {
135  return this->d == other.d;
136  }

The documentation for this class was generated from the following file: