SMARTP< T > Class Template Reference

the smart pointer implementation More...

#include <smartpointer.h>

List of all members.

Public Member Functions

 SMARTP ()
 an empty constructor - points to null
 SMARTP (T *rawptr)
 build a smart pointer from a class pointer
template<class T2 >
 SMARTP (const SMARTP< T2 > &ptr)
 build a smart pointer from an convertible class reference
 SMARTP (const SMARTP &ptr)
 build a smart pointer from another smart pointer reference
 ~SMARTP ()
 the smart pointer destructor: simply removes one reference count
 operator T * () const
 cast operator to retrieve the actual class pointer
T & operator* () const
 '*' operator to access the actual class pointer
T * operator-> () const
 operator -> overloading to access the actual class pointer
template<class T2 >
SMARTPoperator= (T2 p1_)
 operator = that moves the actual class pointer
SMARTPoperator= (T *p_)
 operator = that moves the actual class pointer
SMARTPoperator= (const SMARTP< T > &p_)
 operator = to support inherited class reference
template<class T2 >
SMARTPcast (T2 *p_)
 dynamic cast support
template<class T2 >
SMARTPcast (const SMARTP< T2 > &p_)
 dynamic cast support


Detailed Description

template<class T>
class SMARTP< T >

the smart pointer implementation

A smart pointer is in charge of maintaining the objects reference count by the way of pointers operators overloading. It supports class inheritance and conversion whenever possible.
Instances of the SMARTP class are supposed to use smartable types (or at least objects that implements the addReference and removeReference methods in a consistent way).


Constructor & Destructor Documentation

template<class T>
SMARTP< T >::SMARTP (  )  [inline]

an empty constructor - points to null

template<class T>
SMARTP< T >::SMARTP ( T *  rawptr  )  [inline]

build a smart pointer from a class pointer

template<class T>
template<class T2 >
SMARTP< T >::SMARTP ( const SMARTP< T2 > &  ptr  )  [inline]

build a smart pointer from an convertible class reference

template<class T>
SMARTP< T >::SMARTP ( const SMARTP< T > &  ptr  )  [inline]

build a smart pointer from another smart pointer reference

template<class T>
SMARTP< T >::~SMARTP (  )  [inline]

the smart pointer destructor: simply removes one reference count


Member Function Documentation

template<class T>
template<class T2 >
SMARTP& SMARTP< T >::cast ( const SMARTP< T2 > &  p_  )  [inline]

dynamic cast support

template<class T>
template<class T2 >
SMARTP& SMARTP< T >::cast ( T2 *  p_  )  [inline]

dynamic cast support

template<class T>
SMARTP< T >::operator T * (  )  const [inline]

cast operator to retrieve the actual class pointer

template<class T>
T& SMARTP< T >::operator* (  )  const [inline]

'*' operator to access the actual class pointer

template<class T>
T* SMARTP< T >::operator-> (  )  const [inline]

operator -> overloading to access the actual class pointer

template<class T>
SMARTP& SMARTP< T >::operator= ( const SMARTP< T > &  p_  )  [inline]

operator = to support inherited class reference

template<class T>
SMARTP& SMARTP< T >::operator= ( T *  p_  )  [inline]

operator = that moves the actual class pointer

template<class T>
template<class T2 >
SMARTP& SMARTP< T >::operator= ( T2  p1_  )  [inline]

operator = that moves the actual class pointer


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

Generated on Wed Jan 28 19:15:48 2009 for VEMUS by  doxygen 1.5.8