Back to index

salome-med  6.5.0
Public Member Functions
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 >:
Inheritance graph
[legend]
Collaboration diagram for MED::SharedPtr< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

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

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.

Definition at line 42 of file MED_SharedPtr.hxx.


Constructor & Destructor Documentation

template<class T>
MED::SharedPtr< T >::SharedPtr ( ) [inline]

Default constructor.

Definition at line 46 of file MED_SharedPtr.hxx.

{}
template<class T>
template<class Y >
MED::SharedPtr< T >::SharedPtr ( Y *  p) [inline, explicit]

Construct the class by any type of a pointer.

Definition at line 50 of file MED_SharedPtr.hxx.

                             : 
      boost::shared_ptr<T>(p) 
    {}
template<class T>
template<class Y >
MED::SharedPtr< T >::SharedPtr ( SharedPtr< Y > const &  r) [inline]

Construct the class by any specialisation of the class.

Definition at line 56 of file MED_SharedPtr.hxx.

                                     :
      boost::shared_ptr<T>(r,boost::detail::dynamic_cast_tag())
    {}

Member Function Documentation

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

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

Definition at line 86 of file MED_SharedPtr.hxx.

    { 
      return *(this->get());
    }
template<class T>
MED::SharedPtr< T >::operator T & ( ) [inline]

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

Definition at line 92 of file MED_SharedPtr.hxx.

    { 
      return *(this->get());
    }
template<class T>
template<class Y >
SharedPtr& MED::SharedPtr< T >::operator() ( Y *  p) [inline]

Introduce a flexible way to reset the wrapped pointer.

Definition at line 72 of file MED_SharedPtr.hxx.

    {
      return operator=<Y>(SharedPtr<Y>(p));
    }
template<class T>
template<class Y >
SharedPtr& MED::SharedPtr< T >::operator() ( SharedPtr< Y > const &  r) [inline]

Introduce a flexible way to reset the wrapped pointer.

Definition at line 80 of file MED_SharedPtr.hxx.

    {
      return operator=<Y>(SharedPtr<Y>(r));
    }
template<class T>
template<class Y >
SharedPtr& MED::SharedPtr< T >::operator= ( SharedPtr< Y > const &  r) [inline]

Copy-constructor.

Definition at line 63 of file MED_SharedPtr.hxx.

    {
      boost::shared_ptr<T>(r,boost::detail::dynamic_cast_tag()).swap(*this);
      return *this;
    }

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