tJUST_CONTROLLED_PTR< T > Class Template Reference

#include <tSafePTR.h>

Collaboration diagram for tJUST_CONTROLLED_PTR< T >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 tJUST_CONTROLLED_PTR (T *x)
 tJUST_CONTROLLED_PTR (const tCheckedPTR< T > &x)
 tJUST_CONTROLLED_PTR (const tJUST_CONTROLLED_PTR< T > &x)
 tJUST_CONTROLLED_PTR ()
tJUST_CONTROLLED_PTR< T > & operator= (T *x)
tJUST_CONTROLLED_PTR< T > & operator= (const tJUST_CONTROLLED_PTR< 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== (const tJUST_CONTROLLED_PTR< T > &x) const
bool operator!= (const tJUST_CONTROLLED_PTR< T > &x) const
void Destroy ()
 ~tJUST_CONTROLLED_PTR ()

Private Member Functions

void AddRef ()
void Release ()

Private Attributes

T * target


Detailed Description

template<class T>
class tJUST_CONTROLLED_PTR< T >

Definition at line 287 of file tSafePTR.h.


Constructor & Destructor Documentation

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

Definition at line 305 of file tSafePTR.h.

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

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

Definition at line 306 of file tSafePTR.h.

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

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

Definition at line 307 of file tSafePTR.h.

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

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

Definition at line 308 of file tSafePTR.h.

00308 :target(NULL){};

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

Definition at line 373 of file tSafePTR.h.

00373                            {
00374         Release();
00375     };


Member Function Documentation

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

Definition at line 290 of file tSafePTR.h.

Referenced by tJUST_CONTROLLED_PTR< nNetObject >::operator=(), and tJUST_CONTROLLED_PTR< nNetObject >::tJUST_CONTROLLED_PTR().

00290                  {
00291         if (target)
00292             target->AddRef();
00293     }

Here is the caller graph for this function:

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

Definition at line 295 of file tSafePTR.h.

Referenced by nNOInitialisator< T >::Init(), tJUST_CONTROLLED_PTR< nNetObject >::operator=(), and tJUST_CONTROLLED_PTR< nNetObject >::~tJUST_CONTROLLED_PTR().

00295                   {
00296         if (target){
00297             T *dummy=target;
00298             target=NULL;
00299             dummy->Release();
00300         }
00301     }

Here is the caller graph for this function:

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

Definition at line 311 of file tSafePTR.h.

Referenced by tJUST_CONTROLLED_PTR< nNetObject >::operator=().

00311                                             {
00312         if (target!=x){
00313             Release();
00314             target=x;
00315             AddRef();
00316         }
00317         return *this;
00318     }

Here is the caller graph for this function:

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

Definition at line 320 of file tSafePTR.h.

00320                                                                         {
00321         operator=(x.target);
00322         return *this;
00323     }

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

Definition at line 325 of file tSafePTR.h.

00325                            {
00326         return target;
00327     }

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

Definition at line 329 of file tSafePTR.h.

00329                           {
00330         return *target;
00331     }

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

Definition at line 333 of file tSafePTR.h.

00333                         {
00334         return target;
00335     }

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

Definition at line 343 of file tSafePTR.h.

00343                                     {
00344         return target==x;
00345     }

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

Definition at line 347 of file tSafePTR.h.

00347                                     {
00348         return target!=x;
00349     }

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

Definition at line 351 of file tSafePTR.h.

00351                                                           {
00352         return target==x.target;
00353     }

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

Definition at line 355 of file tSafePTR.h.

00355                                                           {
00356         return target!=x.target;
00357     }

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

Definition at line 359 of file tSafePTR.h.

00359                   {
00360         if (target){
00361 #ifdef tSAFEPTR
00362             T *dummy=(T *)target;
00363             target=NULL;
00364             delete dummy;
00365 #else
00366             delete target();
00367             target=NULL;
00368 #endif
00369         }
00370     }


Member Data Documentation

template<class T>
T* tJUST_CONTROLLED_PTR< T >::target [private]

Definition at line 288 of file tSafePTR.h.

Referenced by tJUST_CONTROLLED_PTR< nNetObject >::AddRef(), tJUST_CONTROLLED_PTR< nNetObject >::Destroy(), tJUST_CONTROLLED_PTR< nNetObject >::operator *(), tJUST_CONTROLLED_PTR< uBind >::operator uBind *(), tJUST_CONTROLLED_PTR< nNetObject >::operator!=(), tJUST_CONTROLLED_PTR< nNetObject >::operator->(), tJUST_CONTROLLED_PTR< nNetObject >::operator=(), tJUST_CONTROLLED_PTR< nNetObject >::operator==(), and tJUST_CONTROLLED_PTR< nNetObject >::Release().


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