src/tools/tSafePTR.h File Reference

#include "aa_config.h"
#include <stddef.h>
#include "tError.h"

Include dependency graph for tSafePTR.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  tCheckedPTRBase
class  tCheckedPTR< T >
class  tCheckedPTRConst< T >
class  tControlledPTR< T >
class  tJUST_CONTROLLED_PTR< T >
class  tStackObject< T >
struct  tNonMutex
class  tReferencable< T, MUTEX >

Defines

#define tDESTROY_PTR(x)   SafeDeletePtr(x)
#define tDESTROY(x)   SafeDeletePtr(x)
#define tCHECK_DEST
#define tCHECKED_PTR(x)   x *
#define tCHECKED_PTR_CONST(x)   const x *
#define tCONTROLLED_PTR(x)   tControlledPTR<x>

Functions

template<class T>
void SafeDelete (T &x)
template<class T>
void SafeDeletePtr (T *&x)
template<class T>
bool operator== (const T *x, const tJUST_CONTROLLED_PTR< T > &y)
template<class T>
bool operator== (T *x, const tJUST_CONTROLLED_PTR< T > &y)
template<class T>
bool operator== (const T *x, tJUST_CONTROLLED_PTR< T > &y)
template<class T>
bool operator== (T *x, tJUST_CONTROLLED_PTR< T > &y)


Define Documentation

#define tCHECK_DEST

Definition at line 162 of file tSafePTR.h.

Referenced by eCamera::~eCamera(), eGameObject::~eGameObject(), ePlayer::~ePlayer(), eWall::~eWall(), gAIPlayer::~gAIPlayer(), nMessage::~nMessage(), nNetObject::~nNetObject(), nWaitForAckSync::~nWaitForAckSync(), rModel::~rModel(), and rViewport::~rViewport().

#define tCHECKED_PTR ( x   )     x *

Definition at line 163 of file tSafePTR.h.

#define tCHECKED_PTR_CONST ( x   )     const x *

Definition at line 164 of file tSafePTR.h.

#define tCONTROLLED_PTR ( x   )     tControlledPTR<x>

Definition at line 167 of file tSafePTR.h.

Referenced by eVoteItem::GetControlMessage(), and eVoter::RemoveFromGame().

#define tDESTROY ( x   )     SafeDeletePtr(x)

Definition at line 161 of file tSafePTR.h.

Referenced by ePlayer::DeleteConfitems(), exit_game_objects(), sn_StrongWatchersRelease(), and gLogo::~gLogo().

#define tDESTROY_PTR ( x   )     SafeDeletePtr(x)

Definition at line 145 of file tSafePTR.h.


Function Documentation

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

Definition at line 394 of file tSafePTR.h.

00395 {
00396     return (x == static_cast<const T*>(y));
00397 }

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

Definition at line 389 of file tSafePTR.h.

00390 {
00391     return (x == static_cast<const T*>(y));
00392 }

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

Definition at line 384 of file tSafePTR.h.

00385 {
00386     return (x == static_cast<const T*>(y));
00387 }

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

Definition at line 379 of file tSafePTR.h.

00380 {
00381     return (x == static_cast<const T*>(y));
00382 }

template<class T>
void SafeDelete ( T &  x  )  [inline]

Definition at line 133 of file tSafePTR.h.

00133                                        {
00134     x.Destroy();
00135 }

template<class T>
void SafeDeletePtr ( T *&  x  )  [inline]

Definition at line 137 of file tSafePTR.h.

References NULL.

00137                                             {
00138     if (x){
00139         T *dummy=x;
00140         x=NULL;
00141         delete dummy;
00142     }
00143 }


Generated on Sat Mar 15 23:12:35 2008 for Armagetron Advanced by  doxygen 1.5.4