MURE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Member Functions | Private Attributes | List of all members
Reference_ptr< T > Class Template Reference

Handle dynamical object creation and pointer affectation. More...

#include <TReference.hxx>

Public Member Functions

 Reference_ptr (T *p=0)
 Normal constructor. More...
 
 Reference_ptr (const Reference_ptr &r)
 Copy constructor. More...
 
 ~Reference_ptr ()
 Normal destructor. More...
 
T & operator* () const
 return the object of the template class More...
 
T * operator-> () const
 return a pointer to the template class More...
 
T * Get () const
 return a pointer to the template class (usefull for cast) More...
 
Reference_ptroperator= (const Reference_ptr &r)
 Affectation ; destroy old ptr if is no more referenced. More...
 
Reference_ptroperator= (T *p)
 Affectation ; destroy old ptr if is no more referenced. More...
 
bool operator== (T *p)
 Comparaison of Pointer. More...
 
bool operator!= (T *p)
 Comparaison of Pointer. More...
 

Private Attributes

T * ptr
 Pointer to the template class T. More...
 

Detailed Description

template<class T>
class Reference_ptr< T >

Handle dynamical object creation and pointer affectation.

It adds TReference to an objet when created and destroy an object only when there is no more TReference on it. A Reference_ptr contain a pointer to the template class.

Author
WEC
Version
1.0

Constructor & Destructor Documentation

template<class T>
Reference_ptr< T >::Reference_ptr ( T *  p = 0)
inlineexplicit

Normal constructor.

template<class T>
Reference_ptr< T >::Reference_ptr ( const Reference_ptr< T > &  r)
inline

Copy constructor.

template<class T>
Reference_ptr< T >::~Reference_ptr ( )
inline

Normal destructor.

Member Function Documentation

template<class T>
T* Reference_ptr< T >::Get ( ) const
inline

return a pointer to the template class (usefull for cast)

template<class T>
bool Reference_ptr< T >::operator!= ( T *  p)
inline

Comparaison of Pointer.

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

return the object of the template class

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

return a pointer to the template class

template<class T>
Reference_ptr& Reference_ptr< T >::operator= ( const Reference_ptr< T > &  r)
inline

Affectation ; destroy old ptr if is no more referenced.

template<class T>
Reference_ptr& Reference_ptr< T >::operator= ( T *  p)
inline

Affectation ; destroy old ptr if is no more referenced.

Parameters
pAffectation ; destroy old ptr if is no more referenced
template<class T>
bool Reference_ptr< T >::operator== ( T *  p)
inline

Comparaison of Pointer.

Member Data Documentation

template<class T>
T* Reference_ptr< T >::ptr
private

Pointer to the template class T.


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

MURE Project, documentation generated by Doxygen 1.8.5 - Mon Nov 17 2014