#include <sp_smartpointer.h>
Public Member Functions | |
| SP_SMARTP () | |
| an empty constructor - points to null | |
| SP_SMARTP (T *rawptr) | |
| build a smart pointer from a class pointer | |
| template<class T2 > | |
| SP_SMARTP (const SP_SMARTP< T2 > &ptr) | |
| build a smart pointer from an convertible class reference | |
| SP_SMARTP (const SP_SMARTP &ptr) | |
| build a smart pointer from another smart pointer reference | |
| ~SP_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 | |
| bool | operator< (T *p_) const |
| template<class T2 > | |
| SP_SMARTP & | operator= (T2 p1_) |
| operator = that moves the actual class pointer | |
| SP_SMARTP & | operator= (T *p_) |
| operator = that moves the actual class pointer | |
| SP_SMARTP & | operator= (const SP_SMARTP< T > &p_) |
| operator = to support inherited class reference | |
| template<class T2 > | |
| SP_SMARTP & | cast (T2 *p_) |
| dynamic cast support | |
| template<class T2 > | |
| SP_SMARTP & | cast (const SP_SMARTP< T2 > &p_) |
| dynamic cast support | |
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).
build a smart pointer from a class pointer
| SP_SMARTP< T >::SP_SMARTP | ( | const SP_SMARTP< T2 > & | ptr | ) | [inline] |
build a smart pointer from an convertible class reference
build a smart pointer from another smart pointer reference
the smart pointer destructor: simply removes one reference count
| SP_SMARTP& SP_SMARTP< T >::cast | ( | const SP_SMARTP< T2 > & | p_ | ) | [inline] |
dynamic cast support
dynamic cast support
| SP_SMARTP< T >::operator T * | ( | ) | const [inline] |
cast operator to retrieve the actual class pointer
| T& SP_SMARTP< T >::operator* | ( | ) | const [inline] |
'*' operator to access the actual class pointer
| T* SP_SMARTP< T >::operator-> | ( | ) | const [inline] |
operator -> overloading to access the actual class pointer
| bool SP_SMARTP< T >::operator< | ( | T * | p_ | ) | const [inline] |
operator = to support inherited class reference
operator = that moves the actual class pointer
operator = that moves the actual class pointer
1.5.8