FAUST compiler  0.9.9.6b8
Public Member Functions | Private Attributes
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
Toperator* () const
Toperator-> () const
Tpointee () 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

Tp

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.

: p(0)                          { }
template<class T>
P< T >::P ( T rawptr) [inline]

Definition at line 39 of file smartpointer.hh.

: p(rawptr)         { }
template<class T>
P< T >::P ( const P< T > &  ptr) [inline]

Definition at line 40 of file smartpointer.hh.

: 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.

: p((T*)ptr)    { }
template<class T>
P< T >::~P ( ) [inline]

Definition at line 45 of file smartpointer.hh.

{ }

Member Function Documentation

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=().

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

Here is the call graph for this function:

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=().

{ 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.

{ return p; }
template<class T>
T& P< T >::operator* ( ) const [inline]

Definition at line 48 of file smartpointer.hh.

References P< T >::p.

                             {
            if (p == 0) {
                //throw std::runtime_error("Null dereference in P<?>::operator*() const ");
                fprintf(stderr, "Null dereference in P<?>::operator*() const \n ");
                exit(1);
            }
            return *p;
        }
template<class T>
T* P< T >::operator-> ( ) const [inline]

Definition at line 56 of file smartpointer.hh.

References P< T >::p.

                                { 
            if (p == 0) {
                fprintf(stderr, "Null dereference in P<?>::operator->() const \n ");
                //throw std::runtime_error("Null dereference in P<?>::operator->() const ");
                //std::cerr << "Null dereference in P<?>::operator->() const " << std::endl;
                exit(1);
            }
            return p;
        }
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().

{ p = p_;  return *this;}

Here is the caller graph for this function:

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=().

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

Here is the call graph for this function:

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.

{ return p;}

Member Data Documentation

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

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