MURE
Loading...
Searching...
No Matches
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=nullptr)
 
 Reference_ptr (const Reference_ptr &r)
 
 ~Reference_ptr ()
 
T & operator* () const
 
T * operator-> () const
 
T * Get () const
 
Reference_ptroperator= (const Reference_ptr &r)
 Affectation ; destroy old ptr if is no more referenced.
 
Reference_ptroperator= (T *p)
 Affectation ; destroy old ptr if is no more referenced.
 
bool operator== (T *p)
 
bool operator!= (T *p)
 

Private Attributes

T * ptr
 Pointer to the template class T.
 

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 (smart pointer).

Author
WEC
Version
1.0

Constructor & Destructor Documentation

◆ Reference_ptr() [1/2]

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

< Normal constructor

◆ Reference_ptr() [2/2]

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

< Copy constructor

◆ ~Reference_ptr()

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

< Normal destructor

Member Function Documentation

◆ Get()

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

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

◆ operator!=()

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

< Comparaison of Pointer

◆ operator*()

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

< return the object of the template class

◆ operator->()

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

< return a pointer to the template class

◆ operator=() [1/2]

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

Affectation ; destroy old ptr if is no more referenced.

◆ operator=() [2/2]

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

◆ operator==()

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

< Comparaison of Pointer

Member Data Documentation

◆ ptr

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.9.7 - Fri Jan 19 2024