Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

FastShower::SP< Type > Class Template Reference

Smart Pointer template. More...

#include <SP.h>

Inheritance diagram for FastShower::SP< Type >:

Inheritance graph
[legend]
Collaboration diagram for FastShower::SP< Type >:

Collaboration graph
[legend]
List of all members.

Public Methods

 SP ()
 ~SP ()
 SP (Type *p)
 SP (const SP &)
SP< Type > & operator= (const SP< Type > &rhs)
SP< Type > & operator= (Type *rhs)
 operator Type * () const
Type * operator-> () const
Type operator * () const

Private Attributes

Type * m_pointer

Detailed Description

template<class Type>
class FastShower::SP< Type >

Smart Pointer template.

Definition at line 22 of file SP.h.


Constructor & Destructor Documentation

template<class Type>
FastShower::SP< Type >::SP   [inline]
 

Definition at line 24 of file SP.h.

00024 : m_pointer(0){}

template<class Type>
FastShower::SP< Type >::~SP   [inline]
 

Definition at line 25 of file SP.h.

00025 {delete m_pointer;}

template<class Type>
FastShower::SP< Type >::SP Type *    p [inline]
 

Definition at line 44 of file SP.h.

00044                        : m_pointer(p){
00045   }

template<class Type>
FastShower::SP< Type >::SP const SP< Type > &    [inline]
 

Definition at line 48 of file SP.h.

References FastShower::SP< Type >::m_pointer.

00048                                    {
00049     m_pointer = (rhs.m_pointer==0)? 0:rhs->clone();
00050   }

Member Function Documentation

template<class Type>
SP< Type > & FastShower::SP< Type >::operator= const SP< Type > &    rhs [inline]
 

Definition at line 59 of file SP.h.

References FastShower::SP< Type >::m_pointer.

00059                                                     {
00060     if(m_pointer != rhs.m_pointer){m_pointer = rhs->clone();}
00061     return *this;
00062   }

template<class Type>
SP< Type > & FastShower::SP< Type >::operator= Type *    rhs [inline]
 

Definition at line 53 of file SP.h.

References FastShower::SP< Type >::m_pointer.

00053                                           {
00054     m_pointer = ptr;
00055     return *this;
00056   }

template<class Type>
FastShower::SP< Type >::operator Type *   const [inline]
 

Definition at line 30 of file SP.h.

00030                            {
00031     //  IDebug* dbg = m_pointer;
00032     //  cout<<"casting  a "<<dbg->name()<<" "<<dbg->text()<<endl;
00033       return  m_pointer;}

template<class Type>
Type* FastShower::SP< Type >::operator->   const [inline]
 

Definition at line 34 of file SP.h.

00034                              {
00035     //  IDebug* dbg = m_pointer;
00036     //  cout<<"dereferencing a "<<dbg->name()<<" "<<dbg->text()<<endl;
00037       return  m_pointer;}

template<class Type>
Type FastShower::SP< Type >::operator *   const [inline]
 

Definition at line 38 of file SP.h.

00038 {return *m_pointer;}

Member Data Documentation

template<class Type>
Type* FastShower::SP< Type >::m_pointer [private]
 

Definition at line 40 of file SP.h.

Referenced by FastShower::SP< IUpdatingGaussian >::operator *(), FastShower::SP< IUpdatingGaussian >::operator Type *(), FastShower::SP< IUpdatingGaussian >::operator->(), FastShower::SP< Type >::operator=(), FastShower::SP< Type >::SP(), FastShower::SP< IUpdatingGaussian >::SP(), and FastShower::SP< IUpdatingGaussian >::~SP().


The documentation for this class was generated from the following file:
Generated on Tue Mar 18 11:58:34 2003 for FastShowerUtils by doxygen1.3-rc1