Version: 8.3.0
MED::SharedPtr< T > Class Template Reference

To extend the boost::shared_ptr to support such features automatic dynamic cast. More...

#include <MED_SharedPtr.hxx>

Inheritance diagram for MED::SharedPtr< T >:

Public Member Functions

 SharedPtr ()
 Default constructor. More...
 
template<class Y >
 SharedPtr (Y *p)
 Construct the class by any type of a pointer. More...
 
template<class Y >
 SharedPtr (SharedPtr< Y > const &r)
 Construct the class by any specialisation of the class. More...
 
template<class Y >
SharedPtroperator= (SharedPtr< Y > const &r)
 Copy-constructor. More...
 
template<class Y >
SharedPtroperator() (Y *p)
 Introduce a flexible way to reset the wrapped pointer. More...
 
template<class Y >
SharedPtroperator() (SharedPtr< Y > const &r)
 Introduce a flexible way to reset the wrapped pointer. More...
 
 operator const T & () const
 To provide a flexible way to use reference to the wrapped pointer (const version) More...
 
 operator T & ()
 To provide a flexible way to use reference to the wrapped pointer. More...
 

Detailed Description

template<class T>
class MED::SharedPtr< T >

To extend the boost::shared_ptr to support such features automatic dynamic cast.

All entities of the MEDWrapper package are handled as pointer. This class was introduced to provide correct and flexible memory management for all of the MEDWrapper objects.

Constructor & Destructor Documentation

template<class T>
MED::SharedPtr< T >::SharedPtr ( )

Default constructor.

template<class T>
template<class Y >
MED::SharedPtr< T >::SharedPtr ( Y *  p)
explicit

Construct the class by any type of a pointer.

template<class T>
template<class Y >
MED::SharedPtr< T >::SharedPtr ( SharedPtr< Y > const &  r)

Construct the class by any specialisation of the class.

Member Function Documentation

template<class T>
MED::SharedPtr< T >::operator const T & ( ) const

To provide a flexible way to use reference to the wrapped pointer (const version)

template<class T>
MED::SharedPtr< T >::operator T & ( )

To provide a flexible way to use reference to the wrapped pointer.

template<class T>
template<class Y >
SharedPtr& MED::SharedPtr< T >::operator() ( Y *  p)

Introduce a flexible way to reset the wrapped pointer.

template<class T>
template<class Y >
SharedPtr& MED::SharedPtr< T >::operator() ( SharedPtr< Y > const &  r)

Introduce a flexible way to reset the wrapped pointer.

template<class T>
template<class Y >
SharedPtr& MED::SharedPtr< T >::operator= ( SharedPtr< Y > const &  r)

Copy-constructor.