tControlledPTR< T > Class Template Reference

#include <tSafePTR.h>

List of all members.

Public Member Functions

 tControlledPTR (T *x)
 tControlledPTR (const tCheckedPTR< T > &x)
 tControlledPTR (const tControlledPTR< T > &x)
 tControlledPTR ()
tControlledPTR< T > & operator= (T *x)
tControlledPTR< T > & operator= (const tControlledPTR< T > &x)
T * operator-> () const
T & operator * () const
 operator T * () const
bool operator== (const T *x) const
bool operator!= (const T *x) const
bool operator== (T *x) const
bool operator!= (T *x) const
 operator bool () const
bool operator! () const
bool operator== (const tControlledPTR< T > &x) const
bool operator!= (const tControlledPTR< T > &x) const
void Destroy ()
 ~tControlledPTR ()

Private Member Functions

 tCHECKED_PTR (T) target
void AddRef ()
void Release ()


Detailed Description

template<class T>
class tControlledPTR< T >

Definition at line 171 of file tSafePTR.h.


Constructor & Destructor Documentation

template<class T>
tControlledPTR< T >::tControlledPTR ( T *  x  )  [inline]

Definition at line 194 of file tSafePTR.h.

00194 :target(x){AddRef();}

template<class T>
tControlledPTR< T >::tControlledPTR ( const tCheckedPTR< T > &  x  )  [inline]

Definition at line 195 of file tSafePTR.h.

00195 :target(x.operator->()){AddRef();}

template<class T>
tControlledPTR< T >::tControlledPTR ( const tControlledPTR< T > &  x  )  [inline]

Definition at line 196 of file tSafePTR.h.

00196 :target(x.target){AddRef();}

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

Definition at line 197 of file tSafePTR.h.

00197 :target(NULL){};

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

Definition at line 282 of file tSafePTR.h.

00282                      {
00283         Release();
00284     };


Member Function Documentation

template<class T>
tControlledPTR< T >::tCHECKED_PTR (  )  [private]

template<class T>
void tControlledPTR< T >::AddRef ( void   )  [inline, private]

Definition at line 174 of file tSafePTR.h.

Referenced by tControlledPTR< eHalfEdge >::operator=(), and tControlledPTR< eHalfEdge >::tControlledPTR().

00174                  {
00175         if (target)
00176             target->AddRef();
00177     }

Here is the caller graph for this function:

template<class T>
void tControlledPTR< T >::Release (  )  [inline, private]

Definition at line 179 of file tSafePTR.h.

Referenced by tControlledPTR< eHalfEdge >::operator=(), and tControlledPTR< eHalfEdge >::~tControlledPTR().

00179                   {
00180         if (target){
00181             //#ifdef tSAFEPTR
00182             T *dummy=reinterpret_cast<T*>(target);
00183             target=NULL;
00184             dummy->Release();
00185             //#else
00186             //      target->Release();
00187             //      target=NULL;
00188             //#endif
00189         }
00190     }

Here is the caller graph for this function:

template<class T>
tControlledPTR<T>& tControlledPTR< T >::operator= ( T *  x  )  [inline]

Definition at line 200 of file tSafePTR.h.

00200                                       {
00201         if (target!=x){
00202             Release();
00203             target=x;
00204             AddRef();
00205         }
00206         return *this;
00207     }

template<class T>
tControlledPTR<T>& tControlledPTR< T >::operator= ( const tControlledPTR< T > &  x  )  [inline]

Definition at line 209 of file tSafePTR.h.

00209                                                             {
00210         if (target!=x.target){
00211             Release();
00212             target=x.target;
00213             AddRef();
00214         }
00215         return *this;
00216     }

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

Definition at line 218 of file tSafePTR.h.

00218                            {
00219         return target;
00220     }

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

Definition at line 222 of file tSafePTR.h.

00222                           {
00223         return *target;
00224     }

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

Definition at line 226 of file tSafePTR.h.

00226                         {
00227         return target;
00228     }

template<class T>
bool tControlledPTR< T >::operator== ( const T *  x  )  const [inline]

Definition at line 236 of file tSafePTR.h.

00236                                     {
00237         return target==x;
00238     }

template<class T>
bool tControlledPTR< T >::operator!= ( const T *  x  )  const [inline]

Definition at line 240 of file tSafePTR.h.

00240                                     {
00241         return target!=x;
00242     }

template<class T>
bool tControlledPTR< T >::operator== ( T *  x  )  const [inline]

Definition at line 244 of file tSafePTR.h.

00244                               {
00245         return target==x;
00246     }

template<class T>
bool tControlledPTR< T >::operator!= ( T *  x  )  const [inline]

Definition at line 248 of file tSafePTR.h.

00248                               {
00249         return target!=x;
00250     }

template<class T>
tControlledPTR< T >::operator bool (  )  const [inline]

Definition at line 252 of file tSafePTR.h.

00252                         {
00253         return target!=NULL;
00254     }

template<class T>
bool tControlledPTR< T >::operator! (  )  const [inline]

Definition at line 256 of file tSafePTR.h.

00256                           {
00257         return target==NULL;
00258     }

template<class T>
bool tControlledPTR< T >::operator== ( const tControlledPTR< T > &  x  )  const [inline]

Definition at line 260 of file tSafePTR.h.

00260                                                     {
00261         return target==x.target;
00262     }

template<class T>
bool tControlledPTR< T >::operator!= ( const tControlledPTR< T > &  x  )  const [inline]

Definition at line 264 of file tSafePTR.h.

00264                                                     {
00265         return target!=x.target;
00266     }

template<class T>
void tControlledPTR< T >::Destroy ( void   )  [inline]

Definition at line 268 of file tSafePTR.h.

00268                   {
00269         if (target){
00270 #ifdef tSAFEPTR
00271             T *dummy=(T *)target;
00272             target=NULL;
00273             delete dummy;
00274 #else
00275             delete target();
00276             target=NULL;
00277 #endif
00278         }
00279     }


The documentation for this class was generated from the following file:
Generated on Sat Mar 15 23:55:50 2008 for Armagetron Advanced by  doxygen 1.5.4