Qt 4.8
Public Functions | Protected Functions | Friends | List of all members
QDeclarativeGuard< T > Class Template Reference

#include <qdeclarativeguard_p.h>

Inheritance diagram for QDeclarativeGuard< T >:
QDeclarativeGuardImpl

Public Functions

T * data () const
 
bool isNull () const
 
T * object () const
 
 operator T* () const
 
T & operator* () const
 
T * operator-> () const
 
QDeclarativeGuard< T > & operator= (const QDeclarativeGuard< T > &o)
 
QDeclarativeGuard< T > & operator= (T *)
 
 QDeclarativeGuard ()
 
 QDeclarativeGuard (T *)
 
 QDeclarativeGuard (const QDeclarativeGuard< T > &)
 
void setObject (T *g)
 
virtual ~QDeclarativeGuard ()
 

Protected Functions

virtual void objectDestroyed (T *)
 

Friends

class QDeclarativeData
 

Additional Inherited Members

- Private Functions inherited from QDeclarativeGuardImpl
void addGuard ()
 
 QDeclarativeGuardImpl ()
 
 QDeclarativeGuardImpl (QObject *)
 
 QDeclarativeGuardImpl (const QDeclarativeGuardImpl &)
 
void remGuard ()
 
 ~QDeclarativeGuardImpl ()
 
- Properties inherited from QDeclarativeGuardImpl
QDeclarativeGuardImplnext
 
QObjecto
 
QDeclarativeGuardImpl ** prev
 

Detailed Description

template<class T>
class QDeclarativeGuard< T >

Definition at line 80 of file qdeclarativeguard_p.h.

Constructors and Destructors

◆ QDeclarativeGuard() [1/3]

template<class T >
QDeclarativeGuard< T >::QDeclarativeGuard ( )
inline

Definition at line 159 of file qdeclarativeguard_p.h.

160 {
161 }

◆ QDeclarativeGuard() [2/3]

template<class T>
QDeclarativeGuard< T >::QDeclarativeGuard ( T *  g)
inline

Definition at line 164 of file qdeclarativeguard_p.h.

166 {
167 }

◆ QDeclarativeGuard() [3/3]

template<class T>
QDeclarativeGuard< T >::QDeclarativeGuard ( const QDeclarativeGuard< T > &  g)
inline

Definition at line 170 of file qdeclarativeguard_p.h.

172 {
173 }

◆ ~QDeclarativeGuard()

template<class T >
QDeclarativeGuard< T >::~QDeclarativeGuard ( )
inlinevirtual

Definition at line 176 of file qdeclarativeguard_p.h.

177 {
178 }

Functions

◆ data()

template<class T>
T* QDeclarativeGuard< T >::data ( ) const
inline

◆ isNull()

template<class T>
bool QDeclarativeGuard< T >::isNull ( ) const
inline

Definition at line 95 of file qdeclarativeguard_p.h.

96  { return !o; }

◆ object()

template<class T >
T * QDeclarativeGuard< T >::object ( ) const
inline

Definition at line 195 of file qdeclarativeguard_p.h.

Referenced by QDeclarativeGuard< QDeclarativeTransition >::operator=().

196 {
197  return static_cast<T *>(o);
198 };

◆ objectDestroyed()

template<class T>
virtual void QDeclarativeGuard< T >::objectDestroyed ( T *  )
inlineprotectedvirtual

◆ operator T*()

template<class T>
QDeclarativeGuard< T >::operator T* ( ) const
inline

Definition at line 102 of file qdeclarativeguard_p.h.

103  { return static_cast<T*>(const_cast<QObject*>(o)); }
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111

◆ operator*()

template<class T>
T& QDeclarativeGuard< T >::operator* ( ) const
inline

Definition at line 100 of file qdeclarativeguard_p.h.

101  { return *static_cast<T*>(const_cast<QObject*>(o)); }
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111

◆ operator->()

template<class T>
T* QDeclarativeGuard< T >::operator-> ( ) const
inline

Definition at line 98 of file qdeclarativeguard_p.h.

99  { return static_cast<T*>(const_cast<QObject*>(o)); }
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111

◆ operator=() [1/2]

template<class T>
QDeclarativeGuard< T > & QDeclarativeGuard< T >::operator= ( const QDeclarativeGuard< T > &  o)
inline

Definition at line 181 of file qdeclarativeguard_p.h.

Referenced by QDeclarativeContextData::ContextGuard::operator=().

182 {
183  setObject(g.object());
184  return *this;
185 }

◆ operator=() [2/2]

template<class T>
QDeclarativeGuard< T > & QDeclarativeGuard< T >::operator= ( T *  g)
inline

Definition at line 188 of file qdeclarativeguard_p.h.

189 {
190  setObject(g);
191  return *this;
192 }

◆ setObject()

template<class T>
void QDeclarativeGuard< T >::setObject ( T *  g)
inline

Definition at line 201 of file qdeclarativeguard_p.h.

Referenced by QDeclarativeGuard< QDeclarativeTransition >::operator=().

202 {
203  if (g != o) {
204  if (prev) remGuard();
205  o = g;
206  if (o) addGuard();
207  }
208 }
QDeclarativeGuardImpl ** prev

Friends and Related Functions

◆ QDeclarativeData

template<class T>
friend class QDeclarativeData
friend

Definition at line 82 of file qdeclarativeguard_p.h.


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