FAUST compiler  0.9.9.6b8
Public Member Functions | Private Attributes | List of all members
P< T > Class Template Reference

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

38 : p(0) { }
T * p
Definition: smartpointer.hh:36
template<class T>
P< T >::P ( T rawptr)
inline

Definition at line 39 of file smartpointer.hh.

39 : p(rawptr) { }
T * p
Definition: smartpointer.hh:36
template<class T>
P< T >::P ( const P< T > &  ptr)
inline

Definition at line 40 of file smartpointer.hh.

40 : p((T*)ptr) { }
T * p
Definition: smartpointer.hh:36
string T(char *c)
Definition: Text.cpp:158
template<class T>
template<class T2 >
P< T >::P ( const P< T2 > &  ptr)
inline

Definition at line 43 of file smartpointer.hh.

43 : p((T*)ptr) { }
T * p
Definition: smartpointer.hh:36
string T(char *c)
Definition: Text.cpp:158
template<class T>
P< T >::~P ( )
inline

Definition at line 45 of file smartpointer.hh.

45 { }

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

69 { return operator=(dynamic_cast<T*>(p_)); }
P & operator=(T *p_)
Definition: smartpointer.hh:66

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

70 { return operator=(dynamic_cast<T*>(p_)); }
P & operator=(T *p_)
Definition: smartpointer.hh:66

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.

47 { return p; }
T * p
Definition: smartpointer.hh:36
template<class T>
T& P< T >::operator* ( ) const
inline

Definition at line 48 of file smartpointer.hh.

References P< T >::p.

48  {
49  if (p == 0) {
50  //throw std::runtime_error("Null dereference in P<?>::operator*() const ");
51  fprintf(stderr, "Null dereference in P<?>::operator*() const \n ");
52  exit(1);
53  }
54  return *p;
55  }
T * p
Definition: smartpointer.hh:36
template<class T>
T* P< T >::operator-> ( ) const
inline

Definition at line 56 of file smartpointer.hh.

References P< T >::p.

56  {
57  if (p == 0) {
58  fprintf(stderr, "Null dereference in P<?>::operator->() const \n ");
59  //throw std::runtime_error("Null dereference in P<?>::operator->() const ");
60  //std::cerr << "Null dereference in P<?>::operator->() const " << std::endl;
61  exit(1);
62  }
63  return p;
64  }
T * p
Definition: smartpointer.hh:36
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().

66 { p = p_; return *this;}
T * p
Definition: smartpointer.hh:36

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

68 { return operator=((T *) p_); }
P & operator=(T *p_)
Definition: smartpointer.hh:66
string T(char *c)
Definition: Text.cpp:158

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.

65 { return p;}
T * p
Definition: smartpointer.hh:36

Member Data Documentation

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

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