P< T > Class Template Reference

#include <smartpointer.hh>

List of all members.

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
Poperator= (T *p_)
Poperator= (const P< T > &p_)
template<class T2 >
Pcast (T2 *p_)
template<class T2 >
Pcast (const P< T2 > &p_)

Private Attributes

T * p

Detailed Description

template<class T>
class P< T >

Definition at line 34 of file smartpointer.hh.


Constructor & Destructor Documentation

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

Definition at line 38 of file smartpointer.hh.

00038 : p(0)                          { }

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

Definition at line 39 of file smartpointer.hh.

00039 : p(rawptr)         { }

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

Definition at line 40 of file smartpointer.hh.

00040 : p((T*)ptr)        { }

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

Definition at line 43 of file smartpointer.hh.

00043 : p((T*)ptr)    { }

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

Definition at line 45 of file smartpointer.hh.

00045 { }


Member Function Documentation

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

Definition at line 70 of file smartpointer.hh.

References P< T >::operator=().

00070 { return operator=(dynamic_cast<T*>(p_)); }

Here is the call graph for this function:

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

Definition at line 69 of file smartpointer.hh.

References P< T >::operator=().

00069 { return operator=(dynamic_cast<T*>(p_)); }

Here is the call graph for this function:

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

Definition at line 47 of file smartpointer.hh.

References P< T >::p.

00047 { return p; }

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

Definition at line 48 of file smartpointer.hh.

References P< T >::p.

00048                              {
00049             if (p == 0) {
00050                 //throw std::runtime_error("Null dereference in P<?>::operator*() const ");
00051                 fprintf(stderr, "Null dereference in P<?>::operator*() const \n ");
00052                 exit(1);
00053             }
00054             return *p;
00055         }

template<class T>
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         }

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

Definition at line 68 of file smartpointer.hh.

References P< T >::operator=(), and T().

Referenced by P< T >::operator=().

00068 { return operator=((T *) p_); }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 66 of file smartpointer.hh.

References P< T >::p.

Referenced by P< T >::cast().

00066 { p = p_;  return *this;}

Here is the caller graph for this function:

template<class T>
T* P< T >::pointee (  )  const [inline]

Definition at line 65 of file smartpointer.hh.

References P< T >::p.

00065 { return p;}


Member Data Documentation

template<class T>
T* P< T >::p [private]

The documentation for this class was generated from the following file:
Generated on Thu Jul 15 16:15:59 2010 for FAUST compiler by  doxygen 1.6.3