IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QExtend::ExtendPtr< T, DeletePolicy > Class Template Reference

QObject Smart pointer which create an object and synchronize its life time. //! More...

#include <extendptr.hpp>

List of all members.

Classes

struct  interptr
struct  interptr< false, TPTR >
struct  interptr< true, TPTR >

Public Member Functions

 ExtendPtr (T *p=0)
 Smart pointer Constructor. //!
ExtendPtr< T, DeletePolicy > & operator= (T *p)
 Reassigne pointer to a new object. Use Delete policy on old pointer. //!
 ~ExtendPtr ()
 Smart pointer Destructor. Use DeletePolicy to decide if object should be deleted. //!
bool isNull () const
 Test if the pointer is null. //!
 operator bool () const
 Bool convertion. It's true if object is not destroyed (Parent destruction). //!
 operator T * ()
 Cast to the object pointer. //!
 operator const T * () const
 Cast to the const object pointer. //!
T * operator-> ()
 Indirection Operator. //!
const T * operator-> () const
 Indirection Operator. //!
T & operator* ()
 Indirection Operator. //!
const T & operator* () const
 Indirection Operator. //!

Detailed Description

template<typename T, typename DeletePolicy = SCOPE>
class QExtend::ExtendPtr< T, DeletePolicy >

QObject Smart pointer which create an object and synchronize its life time. //!

ExtendPtr is use to interface an object and use a policy for object destruction. Proposed features are :

  1. Interface an Object.
  2. Can use polymorphisme.
  3. it is not copiable
  4. It is reasignable (use delete policy to the old object)
  5. If the object inherint from QObject, check the object life(Qt parent/child destruction feature)
  6. When it's destroyed, use a policy on object destruction.
Template Parameters:
T Object type.
DeletePolicy delete object policy used. Defaut is SCOPE policy.

Definition at line 68 of file extendptr.hpp.


Constructor & Destructor Documentation

template<typename T, typename DeletePolicy = SCOPE>
QExtend::ExtendPtr< T, DeletePolicy >::ExtendPtr ( T *  p = 0  )  [inline]

Smart pointer Constructor. //!

Create Object with its default constructor.

Parameters:
p Object pointer.

Definition at line 121 of file extendptr.hpp.

template<typename T, typename DeletePolicy = SCOPE>
QExtend::ExtendPtr< T, DeletePolicy >::~ExtendPtr (  )  [inline]

Smart pointer Destructor. Use DeletePolicy to decide if object should be deleted. //!

Delete Object.

Definition at line 161 of file extendptr.hpp.


Member Function Documentation

template<typename T, typename DeletePolicy = SCOPE>
bool QExtend::ExtendPtr< T, DeletePolicy >::isNull (  )  const [inline]

Test if the pointer is null. //!

Returns:
Returns true if pointer is null.

Definition at line 180 of file extendptr.hpp.

template<typename T, typename DeletePolicy = SCOPE>
QExtend::ExtendPtr< T, DeletePolicy >::operator bool (  )  const [inline]

Bool convertion. It's true if object is not destroyed (Parent destruction). //!

Definition at line 187 of file extendptr.hpp.

template<typename T, typename DeletePolicy = SCOPE>
QExtend::ExtendPtr< T, DeletePolicy >::operator const T * (  )  const [inline]

Cast to the const object pointer. //!

Definition at line 201 of file extendptr.hpp.

template<typename T, typename DeletePolicy = SCOPE>
QExtend::ExtendPtr< T, DeletePolicy >::operator T * (  )  [inline]

Cast to the object pointer. //!

Definition at line 194 of file extendptr.hpp.

template<typename T, typename DeletePolicy = SCOPE>
T& QExtend::ExtendPtr< T, DeletePolicy >::operator* (  )  [inline]

Indirection Operator. //!

Returns:
Returns a reference to the object.

Definition at line 249 of file extendptr.hpp.

template<typename T, typename DeletePolicy = SCOPE>
const T& QExtend::ExtendPtr< T, DeletePolicy >::operator* (  )  const [inline]

Indirection Operator. //!

Returns:
Returns a const reference to the object.

Definition at line 265 of file extendptr.hpp.

template<typename T, typename DeletePolicy = SCOPE>
const T* QExtend::ExtendPtr< T, DeletePolicy >::operator-> (  )  const [inline]

Indirection Operator. //!

Returns:
Returns the const object pointer.

Definition at line 233 of file extendptr.hpp.

template<typename T, typename DeletePolicy = SCOPE>
T* QExtend::ExtendPtr< T, DeletePolicy >::operator-> (  )  [inline]

Indirection Operator. //!

Returns:
Returns the object pointer.

Definition at line 218 of file extendptr.hpp.

template<typename T, typename DeletePolicy = SCOPE>
ExtendPtr<T,DeletePolicy>& QExtend::ExtendPtr< T, DeletePolicy >::operator= ( T *  p  )  [inline]

Reassigne pointer to a new object. Use Delete policy on old pointer. //!

Create Object with its default constructor.

Parameters:
p New object pointer.

Definition at line 140 of file extendptr.hpp.


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

Les sources présentées sur cette page sont libres de droits et vous pouvez les utiliser à votre convenance. Par contre, la page de présentation constitue une œuvre intellectuelle protégée par les droits d'auteur. Copyright © 2010 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site ni de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon vous encourez selon la loi jusqu'à trois ans de prison et jusqu'à 300 000 € de dommages et intérêts.