#include <tList.h>
Public Member Functions | |
~tList () | |
tList (int size=0) | |
void | Add (T *t, int &idnum) |
void | Add (T *t) |
void | Remove (T *t, int &idref) |
void | Remove (T *t) |
Private Attributes | |
int | offset |
Definition at line 92 of file tList.h.
void tList< T, MALLOC, REFERENCE >::Add | ( | T * | t, | |
int & | idnum | |||
) | [inline] |
Definition at line 106 of file tList.h.
Referenced by tList< uSelectItem< Vote > >::Add(), nBandwidthSceduler::AddArbitrator(), eGrid::AddEdge(), eGrid::AddFace(), eGrid::AddGameObjectInactive(), eGrid::AddGameObjectInteresting(), uMenu::AddItem(), eTeam::AddPlayer(), eTeam::AddPlayerDirty(), eGrid::AddPoint(), tMemManager::Alloc(), eTeam::Enforce(), ePlayerNetID::ePlayerNetID(), eWallRim::eWallRim(), gStatList::getPlaceInList(), eVoter::GetVoter(), gExplosion::gExplosion(), tMemManager::Insert(), eSoundPlayer::MakeGlobal(), memblock::memblock(), gNetPlayerWall::MyInitAfterCreation(), uMenuItemSelection< bool >::NewChoice(), gArena::NewSpawnPoint(), nWaitForAck::nWaitForAck(), rITexture::OnSelect(), nServerInfo::QueryServer(), tStatFile::read(), gNetPlayerWall::real_CopyIntoGrid(), eTeam::RemovePlayerDirty(), eGameObject::RenderAll(), nNetObject::RequestSync(), uMenu::ReverseItems(), tCheckedPTRBase::tCheckedPTRBase(), and uMenuItem::uMenuItem().
00106 { 00107 offset=&idnum-(reinterpret_cast<int *>(t)); 00108 00109 if (idnum<0){ // tEventQueue relies on the fact that we put t in 00110 idnum=this->Len(); // the last place. 00111 (*this)[idnum]=t; 00112 if ( REFERENCE ) 00113 { 00114 tReferencer< T >::AddReference( t ); 00115 } 00116 } 00117 }
void tList< T, MALLOC, REFERENCE >::Add | ( | T * | t | ) | [inline] |
void tList< T, MALLOC, REFERENCE >::Remove | ( | T * | t, | |
int & | idref | |||
) | [inline] |
Definition at line 124 of file tList.h.
Referenced by uMenuItemSelection< bool >::Clear(), gNetPlayerWall::Clear(), nNetObject::ClearAll(), tMemManager::complete_Dispose(), nServerInfo::DoQueryAll(), nServerInfo::NetReadThis(), gExplosion::OnRemoveFromGame(), gNetPlayerWall::real_CopyIntoGrid(), gNetPlayerWall::ReleaseData(), tMemManager::Remove(), tList< uSelectItem< Vote > >::Remove(), tHeapBase::Remove(), gArena::RemoveAllSpawn(), nBandwidthSceduler::RemoveArbitrator(), eGrid::RemoveEdge(), eGrid::RemoveFace(), eVoter::RemoveFromGame(), eGrid::RemoveGameObjectInactive(), eGrid::RemoveGameObjectInteresting(), uMenu::RemoveItem(), eTeam::RemovePlayerDirty(), eGrid::RemovePoint(), eGameObject::RenderAll(), uMenu::ReverseItems(), nServerInfo::StartQueryAll(), nNetObject::SyncAll(), eTeam::~eTeam(), eVoteItem::~eVoteItem(), eVoter::~eVoter(), eWallRim::~eWallRim(), gArena::~gArena(), gExplosion::~gExplosion(), gStatList::~gStatList(), memblock::~memblock(), nNetObject::~nNetObject(), nServerInfo::~nServerInfo(), rITexture::~rITexture(), tCheckedPTRBase::~tCheckedPTRBase(), and uMenuItem::~uMenuItem().
00125 { 00126 int idnum = idref; 00127 idref = -1; 00128 00129 // con << "offset=" << offset << '\n'; 00130 if ( idnum>=0 ){ 00131 #ifdef DEBUG 00132 if (idnum>=this->Len()) 00133 tERR_ERROR_INT("Corrupted list structure!"); 00134 00135 T *test=(*this)(idnum); 00136 if (test!=t) 00137 tERR_ERROR_INT("Corrupted list structure!"); 00138 #endif 00139 // the check for Len() is done, since this may be 00140 // called on an allready descructed list. 00141 if ( this->Len() > idnum+1 ) 00142 { 00143 T *other=(*this)(this->Len()-1); 00144 tASSERT( other ); 00145 (*this)(idnum)=other; 00146 int &other_id=(reinterpret_cast<int *>(other))[offset]; 00147 tASSERT( other_id == this->Len()-1 ); 00148 other_id=idnum; 00149 } 00150 (*this)[this->Len()-1] = NULL; 00151 00152 SetLen(this->Len()-1); 00153 00154 if ( REFERENCE ) 00155 { 00156 tReferencer< T >::ReleaseReference( t ); 00157 } 00158 } 00159 00160 // tASSERT( idref == -1 ); 00161 }
void tList< T, MALLOC, REFERENCE >::Remove | ( | T * | t | ) | [inline] |
int tList< T, MALLOC, REFERENCE >::offset [private] |
Definition at line 94 of file tList.h.
Referenced by tList< uSelectItem< Vote > >::Add(), tList< uSelectItem< Vote > >::Remove(), and tList< uSelectItem< Vote > >::~tList().