#include <smartpointer.hh>
Public Member Functions | |
P () | |
P (T *rawptr) | |
P (const P &ptr) | |
template<class T2 > | |
P (const P< T2 > &ptr) | |
~P () | |
operator T * () const | |
T & | operator* () const |
T * | operator-> () const |
T * | pointee () const |
P & | operator= (T *p_) |
P & | operator= (const P< T > &p_) |
template<class T2 > | |
P & | cast (T2 *p_) |
template<class T2 > | |
P & | cast (const P< T2 > &p_) |
Private Attributes | |
T * | p |
Definition at line 34 of file smartpointer.hh.
Definition at line 38 of file smartpointer.hh.
00038 : p(0) { }
Definition at line 39 of file smartpointer.hh.
00039 : p(rawptr) { }
Definition at line 40 of file smartpointer.hh.
Definition at line 43 of file smartpointer.hh.
Definition at line 45 of file smartpointer.hh.
Definition at line 70 of file smartpointer.hh.
References P< T >::operator=().
00070 { return operator=(dynamic_cast<T*>(p_)); }
Definition at line 69 of file smartpointer.hh.
References P< T >::operator=().
00069 { return operator=(dynamic_cast<T*>(p_)); }
P< T >::operator T * | ( | ) | const [inline] |
T& P< T >::operator* | ( | ) | const [inline] |
Definition at line 48 of file smartpointer.hh.
References P< T >::p.
T* P< T >::operator-> | ( | ) | const [inline] |
Definition at line 56 of file smartpointer.hh.
References P< T >::p.
00056 { 00057 if (p == 0) { 00058 fprintf(stderr, "Null dereference in P<?>::operator->() const \n "); 00059 //throw std::runtime_error("Null dereference in P<?>::operator->() const "); 00060 //std::cerr << "Null dereference in P<?>::operator->() const " << std::endl; 00061 exit(1); 00062 } 00063 return p; 00064 }
Definition at line 68 of file smartpointer.hh.
References P< T >::operator=(), and T().
Referenced by P< T >::operator=().
Definition at line 66 of file smartpointer.hh.
References P< T >::p.
Referenced by P< T >::cast().
00066 { p = p_; return *this;}
T* P< T >::pointee | ( | ) | const [inline] |
Definition at line 36 of file smartpointer.hh.
Referenced by P< T >::operator T *(), P< T >::operator*(), P< T >::operator->(), P< T >::operator=(), and P< T >::pointee().