#include <tSafePTR.h>
Public Member Functions | |
tCheckedPTRBase (void *x) | |
tCheckedPTRBase (const tCheckedPTRBase &x) | |
tCheckedPTRBase () | |
~tCheckedPTRBase () | |
tCheckedPTRBase & | operator= (void *x) |
operator bool () const | |
bool | operator! () const |
Static Public Member Functions | |
static void | CheckDestructed (void *test) |
static void | Check () |
Protected Attributes | |
void * | target |
Private Attributes | |
int | id |
Friends | |
class | tPTRList |
Definition at line 39 of file tSafePTR.h.
tCheckedPTRBase::tCheckedPTRBase | ( | void * | x | ) |
Definition at line 80 of file tSafePTR.cpp.
References tList< T, MALLOC, REFERENCE >::Add().
00080 :id(-1),target(x){ 00081 tCheckedPTRs.Add(this,id); 00082 }
tCheckedPTRBase::tCheckedPTRBase | ( | const tCheckedPTRBase & | x | ) |
Definition at line 84 of file tSafePTR.cpp.
References tList< T, MALLOC, REFERENCE >::Add().
00085 :id(-1),target(x.target){ 00086 tCheckedPTRs.Add(this,id); 00087 }
tCheckedPTRBase::tCheckedPTRBase | ( | ) |
Definition at line 89 of file tSafePTR.cpp.
References tList< T, MALLOC, REFERENCE >::Add().
00089 :id(-1),target(NULL){ 00090 tCheckedPTRs.Add(this,id); 00091 }
tCheckedPTRBase::~tCheckedPTRBase | ( | ) |
Definition at line 94 of file tSafePTR.cpp.
References tList< T, MALLOC, REFERENCE >::Remove().
00094 { 00095 tCheckedPTRs.Remove(this,id); 00096 }
tCheckedPTRBase& tCheckedPTRBase::operator= | ( | void * | x | ) | [inline] |
Definition at line 50 of file tSafePTR.h.
References target.
Referenced by tCheckedPTRConst< T >::operator=(), and tCheckedPTR< T >::operator=().
tCheckedPTRBase::operator bool | ( | ) | const [inline] |
bool tCheckedPTRBase::operator! | ( | ) | const [inline] |
void tCheckedPTRBase::CheckDestructed | ( | void * | test | ) | [static] |
Definition at line 178 of file tSafePTRBase.cpp.
References id, target, tCheckedPTRs, and tERR_ERROR.
00178 { 00179 for(int i=tCheckedPTRs.Len()-1;i>=0;i--){ 00180 tCheckedPTRBase * adr=tCheckedPTRs(i); 00181 if (adr->id!=i) 00182 tERR_ERROR("Checked ptr list screwed! " 00183 << adr << ":" << adr->id << ":" << adr->target << ":" << i); 00184 00185 if (adr->target==test){ 00186 /* 00187 suspicious(se_rimWalls,adr); 00188 suspicious(sg_netPlayerWalls,adr); 00189 suspicious(gridded_sg_netPlayerWalls,adr); 00190 suspicious(se_cameras,adr); 00191 suspicious(tConfItemBase::tConfItems,adr); 00192 suspicious(eGameObject::gameObjects,adr); 00193 suspicious(eGameObject::gameObjectsInactive,adr); 00194 suspicious(PlayerConfig,adr); 00195 suspicious(se_PlayerNetID,adr); 00196 suspicious(s_playerActions,adr); 00197 suspicious(s_cameraActions,adr); 00198 suspicious(s_globalActions,adr); 00199 suspicious(su_allActions,adr); 00200 suspicious(ePoint::points,adr); 00201 suspicious(eEdge::edges,adr); 00202 suspicious(eFace::faces,adr); 00203 */ 00204 00205 tERR_ERROR("Object destroyed, but pointer at " << adr << 00206 " still points to it!"); 00207 } 00208 } 00209 00210 }
void tCheckedPTRBase::Check | ( | ) | [static] |
Definition at line 212 of file tSafePTRBase.cpp.
References id, target, tCheckedPTRs, and tERR_ERROR.
00212 { 00213 for(int i=tCheckedPTRs.Len()-1;i>=0;i--){ 00214 tCheckedPTRBase * adr=tCheckedPTRs(i); 00215 if (adr->id!=i) 00216 tERR_ERROR("Checked ptr list screwed! " 00217 << adr << ":" << adr->id << ":" << adr->target << ":" << i); 00218 } 00219 }
friend class tPTRList [friend] |
Definition at line 40 of file tSafePTR.h.
int tCheckedPTRBase::id [private] |
void* tCheckedPTRBase::target [protected] |
Definition at line 43 of file tSafePTR.h.
Referenced by Check(), CheckDestructed(), tCheckedPTRConst< T >::Destroy(), tCheckedPTR< T >::Destroy(), tCheckedPTRConst< T >::operator *(), tCheckedPTR< T >::operator *(), operator bool(), tCheckedPTRConst< T >::operator const T *(), tCheckedPTR< T >::operator T *(), operator!(), tCheckedPTRConst< T >::operator!=(), tCheckedPTR< T >::operator!=(), tCheckedPTRConst< T >::operator->(), tCheckedPTR< T >::operator->(), tCheckedPTRConst< T >::operator=(), tCheckedPTR< T >::operator=(), operator=(), tCheckedPTRConst< T >::operator==(), and tCheckedPTR< T >::operator==().