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

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

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

#include <objectptr.hpp>

List of all members.

Classes

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

Public Member Functions

template<typename P1 , typename P2 , typename P3 , typename P4 , typename P5 >
 ObjectPtr (const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5)
 Smart pointer Constructor. //!
template<typename P1 , typename P2 , typename P3 , typename P4 >
 ObjectPtr (const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4)
 Smart pointer Constructor. //!
template<typename P1 , typename P2 , typename P3 >
 ObjectPtr (const P1 &p1, const P2 &p2, const P3 &p3)
 Smart pointer Constructor. //!
template<typename P1 , typename P2 >
 ObjectPtr (const P1 &p1, const P2 &p2)
 Smart pointer Constructor. //!
template<typename P >
 ObjectPtr (const P &p)
 Smart pointer Constructor. //!
 ObjectPtr ()
 Smart pointer Constructor. //!
 ~ObjectPtr ()
 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::ObjectPtr< T, DeletePolicy >

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

ObjectPtr is use to create automatically the object. Proposed features are :

  1. Create Object in its constructor.
  2. Can't use polymorphisme.
  3. it is not copiable or reasignable
  4. Its constructor can give 0 to 5 parameters, use to call the object creator.
  5. If the object inherint from QObject, check the object life(Qt parent/child destruction feature)
  6. When it's destroyed, ude a policy on object destruction.
Template Parameters:
T QObject type.
DeletePolicy delete object policy used. Defaut is SCOPE policy.

Definition at line 68 of file objectptr.hpp.


Constructor & Destructor Documentation

template<typename T, typename DeletePolicy = SCOPE>
template<typename P1 , typename P2 , typename P3 , typename P4 , typename P5 >
QExtend::ObjectPtr< T, DeletePolicy >::ObjectPtr ( const P1 &  p1,
const P2 &  p2,
const P3 &  p3,
const P4 &  p4,
const P5 &  p5 
) [inline]

Smart pointer Constructor. //!

Create Object with five parameters. Parameters types are defined by compilator.

Template Parameters:
P1 First parameter type.
P2 Second parameter type.
P3 Third parameter type.
P4 fourth parameter type.
P5 fifth parameter type.
Parameters:
p1 First parameter.
p2 Second parameter.
p3 Third parameter.
p4 fourth parameter.
p5 fifth parameter.

Definition at line 161 of file objectptr.hpp.

template<typename T, typename DeletePolicy = SCOPE>
template<typename P1 , typename P2 , typename P3 , typename P4 >
QExtend::ObjectPtr< T, DeletePolicy >::ObjectPtr ( const P1 &  p1,
const P2 &  p2,
const P3 &  p3,
const P4 &  p4 
) [inline]

Smart pointer Constructor. //!

Create Object with four parameters. Parameters types are defined by compilator.

Template Parameters:
P1 First parameter type.
P2 Second parameter type.
P3 Third parameter type.
P4 fourth parameter type.
Parameters:
p1 First parameter.
p2 Second parameter.
p3 Third parameter.
p4 fourth parameter.

Definition at line 216 of file objectptr.hpp.

template<typename T, typename DeletePolicy = SCOPE>
template<typename P1 , typename P2 , typename P3 >
QExtend::ObjectPtr< T, DeletePolicy >::ObjectPtr ( const P1 &  p1,
const P2 &  p2,
const P3 &  p3 
) [inline]

Smart pointer Constructor. //!

Create Object with three parameters. Parameters types are defined by compilator.

Template Parameters:
P1 First parameter type.
P2 Second parameter type.
P3 Third parameter type.
Parameters:
p1 First parameter.
p2 Second parameter.
p3 Third parameter.

Definition at line 265 of file objectptr.hpp.

template<typename T, typename DeletePolicy = SCOPE>
template<typename P1 , typename P2 >
QExtend::ObjectPtr< T, DeletePolicy >::ObjectPtr ( const P1 &  p1,
const P2 &  p2 
) [inline]

Smart pointer Constructor. //!

Create Object with two parameters. Parameters types are defined by compilator.

Template Parameters:
P1 First parameter type.
P2 Second parameter type.
Parameters:
p1 First parameter.
p2 Second parameter.

Definition at line 303 of file objectptr.hpp.

template<typename T, typename DeletePolicy = SCOPE>
template<typename P >
QExtend::ObjectPtr< T, DeletePolicy >::ObjectPtr ( const P &  p  )  [inline]

Smart pointer Constructor. //!

Create Object with a parameter. Parameter type is defined by compilator.

Template Parameters:
P parameter type.
Parameters:
p parametre.

Definition at line 334 of file objectptr.hpp.

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

Smart pointer Constructor. //!

Create Object with its default constructor.

Definition at line 353 of file objectptr.hpp.

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

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

Delete Object.

Definition at line 373 of file objectptr.hpp.


Member Function Documentation

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

Test if the pointer is null. //!

Returns:
Returns true if pointer is null.

Definition at line 393 of file objectptr.hpp.

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

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

Definition at line 400 of file objectptr.hpp.

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

Cast to the const object pointer. //!

Definition at line 414 of file objectptr.hpp.

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

Cast to the object pointer. //!

Definition at line 407 of file objectptr.hpp.

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

Indirection Operator. //!

Returns:
Returns a reference to the object.

Definition at line 462 of file objectptr.hpp.

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

Indirection Operator. //!

Returns:
Returns a const reference to the object.

Definition at line 477 of file objectptr.hpp.

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

Indirection Operator. //!

Returns:
Returns the const object pointer.

Definition at line 446 of file objectptr.hpp.

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

Indirection Operator. //!

Returns:
Returns the object pointer.

Definition at line 431 of file objectptr.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.