NLMISC::CstCDbgPtr< T > Class Template Reference

#include <smart_ptr.h>

template<class T>
class NLMISC::CstCDbgPtr< T >


Public Member Functions

 CstCDbgPtr (const CstCDbgPtr &copy)
 CstCDbgPtr (const T *p)
 CstCDbgPtr ()
bool isNULL () const
const T & operator * (void) const
 operator const T * (void) const
const T * operator-> (void) const
bool operator< (const CstCDbgPtr &p) const
CstCDbgPtroperator= (const CstCDbgPtr &p)
CstCDbgPtroperator= (const T *p)
const T * ptr () const
 ~CstCDbgPtr ()

Private Attributes

const T * Ptr

Constructor & Destructor Documentation

template<class T>
NLMISC::CstCDbgPtr< T >::CstCDbgPtr  )  [inline]
 

Definition at line 584 of file smart_ptr.h.

00584 { Ptr=NULL;     }

template<class T>
NLMISC::CstCDbgPtr< T >::CstCDbgPtr const T *  p  )  [inline]
 

Definition at line 585 of file smart_ptr.h.

00586         {
00587                 Ptr=p;
00588 #ifdef NL_DEBUG_PTR
00589                 if(Ptr)
00590                 {
00591                         CDbgRefCount<T> *ref=static_cast<CDbgRefCount<T>*>(const_cast<T*>(Ptr));
00592                         ref->incRef(*this);
00593                 }
00594 #endif
00595         }

template<class T>
NLMISC::CstCDbgPtr< T >::CstCDbgPtr const CstCDbgPtr< T > &  copy  )  [inline]
 

Definition at line 596 of file smart_ptr.h.

References NLMISC::CstCDbgPtr< T >::Ptr.

00597         {
00598                 Ptr=copy.Ptr;
00599 #ifdef NL_DEBUG_PTR
00600         if(Ptr)
00601         {
00602                 CDbgRefCount<T> *ref=static_cast<CDbgRefCount<T>*>(const_cast<T*>(Ptr));
00603                 ref->incRef(*this);
00604         }
00605 #endif
00606         }

template<class T>
NLMISC::CstCDbgPtr< T >::~CstCDbgPtr  )  [inline]
 

Definition at line 630 of file smart_ptr.h.

00631 { 
00632 #ifdef NL_DEBUG_PTR
00633     if(Ptr)
00634         {
00635                 CDbgRefCount<T> *ref=static_cast<CDbgRefCount<T>*>(const_cast<T*>(Ptr));
00636                 ref->decRef(*this);
00637                 Ptr=NULL;
00638         }
00639 #else
00640         Ptr=NULL;
00641 #endif
00642 }


Member Function Documentation

template<class T>
bool NLMISC::CstCDbgPtr< T >::isNULL  )  const [inline]
 

Definition at line 614 of file smart_ptr.h.

00615         {
00616                 return  Ptr==NULL;
00617         }

template<class T>
const T& NLMISC::CstCDbgPtr< T >::operator * void   )  const [inline]
 

Definition at line 620 of file smart_ptr.h.

00620 {       return *Ptr; }

template<class T>
NLMISC::CstCDbgPtr< T >::operator const T * void   )  const [inline]
 

Definition at line 619 of file smart_ptr.h.

00619 {       return Ptr; }

template<class T>
const T* NLMISC::CstCDbgPtr< T >::operator-> void   )  const [inline]
 

Definition at line 621 of file smart_ptr.h.

00621 {       return Ptr; }

template<class T>
bool NLMISC::CstCDbgPtr< T >::operator< const CstCDbgPtr< T > &  p  )  const [inline]
 

Definition at line 671 of file smart_ptr.h.

References NLMISC::CstCDbgPtr< T >::Ptr.

00672 {
00673         return Ptr<p.Ptr;
00674 }

template<class T>
CstCDbgPtr< T > & NLMISC::CstCDbgPtr< T >::operator= const CstCDbgPtr< T > &  p  )  [inline]
 

Definition at line 666 of file smart_ptr.h.

References NLMISC::CstCDbgPtr< T >::Ptr.

00667 {
00668         return CstCDbgPtr<T>::operator=(p.Ptr);
00669 }

template<class T>
CstCDbgPtr< T > & NLMISC::CstCDbgPtr< T >::operator= const T *  p  )  [inline]
 

Definition at line 645 of file smart_ptr.h.

00646 {
00647 #ifdef NL_DEBUG_PTR
00648     if(p)
00649         {
00650                 CDbgRefCount<T> *ref=static_cast<CDbgRefCount<T>*>(const_cast<T*>(p));
00651                 ref->incRef(*this);
00652         }
00653     if(Ptr)
00654         {
00655                 CDbgRefCount<T> *ref=static_cast<CDbgRefCount<T>*>(const_cast<T*>(Ptr));
00656                 ref->decRef(*this);
00657         }
00658         Ptr = p;
00659         
00660 #else
00661         Ptr = p;
00662 #endif
00663         return *this;
00664 }

template<class T>
const T* NLMISC::CstCDbgPtr< T >::ptr  )  const [inline]
 

Definition at line 609 of file smart_ptr.h.

00610         {
00611                 return  Ptr;
00612         }


Field Documentation

template<class T>
const T* NLMISC::CstCDbgPtr< T >::Ptr [private]
 

Definition at line 581 of file smart_ptr.h.

Referenced by NLMISC::CstCDbgPtr< T >::CstCDbgPtr(), NLMISC::CstCDbgPtr< T >::operator<(), and NLMISC::CstCDbgPtr< T >::operator=().


The documentation for this class was generated from the following file:
Generated on Tue Mar 16 13:34:51 2004 for NeL by doxygen 1.3.6