#include <tArray.h>
Public Member Functions | |
void | SetLen (int i) |
~tArray () | |
tArray (int firstsize=0) | |
tArray (const tArray &A) | |
T & | operator[] (int i) |
T const & | operator[] (int i) const |
T & | operator() (int i) const |
T * | operator+ (int i) const |
const tArray< T > & | operator= (const tArray< T > &A) |
void | RemoveAt (int index) |
bool | Remove (const T &t) |
void | Insert (const T &t) |
Protected Member Functions | |
void | Init () |
void | resize (int i) |
void | Clear () |
void | CopyFrom (const tArray &A) |
Definition at line 69 of file tArray.h.
Definition at line 110 of file tArray.h.
00110 { 00111 tERR_FLOW_LOW(); 00112 Clear(); 00113 Delete(MALLOC); 00114 }
Definition at line 117 of file tArray.h.
00118 :GrowingArrayBase(firstsize,sizeof(T),MALLOC) { 00119 // dump(low,flow,"con:size " << firstsize); 00120 Init(); 00121 };
tArray< T, MALLOC >::tArray | ( | const tArray< T, MALLOC > & | A | ) | [inline] |
Definition at line 124 of file tArray.h.
00125 :GrowingArrayBase(A.Len(),sizeof(T),MALLOC){ 00126 CopyFrom(A); 00127 };
void tArray< T, MALLOC >::Init | ( | void | ) | [inline, protected] |
Definition at line 71 of file tArray.h.
Referenced by tArray< uSelectItem< tString > *, false >::tArray().
00071 { 00072 int i; 00073 for(i=Size()-1;i>=0;i--) 00074 new(reinterpret_cast<T *>(Base())+i) T(); 00075 }
void tArray< T, MALLOC >::resize | ( | int | i | ) | [inline, protected] |
Definition at line 77 of file tArray.h.
Referenced by tArray< uSelectItem< tString > *, false >::SetLen().
00077 { 00078 int oldsize=Size(); 00079 ResizeBase(i,sizeof(T),MALLOC); 00080 // dump(low,flow,"Array resize from " << oldsize << " to " << Size()); 00081 for(i=Size()-1;i>=oldsize;i--) 00082 new(reinterpret_cast<T *>(Base())+i) T(); 00083 }
void tArray< T, MALLOC >::Clear | ( | void | ) | [inline, protected] |
Definition at line 86 of file tArray.h.
Referenced by tArray< uSelectItem< tString > *, false >::operator=(), gArena::PrepareGrid(), and tArray< uSelectItem< tString > *, false >::~tArray().
00086 { 00087 int i; 00088 for(i=Size()-1;i>=0;i--){ 00089 // dump(low,flow,"i=" << i); 00090 ((reinterpret_cast<T *>(Base()))+i)->~T(); 00091 } 00092 Delete(MALLOC); 00093 }
void tArray< T, MALLOC >::CopyFrom | ( | const tArray< T, MALLOC > & | A | ) | [inline, protected] |
Definition at line 96 of file tArray.h.
Referenced by tArray< uSelectItem< tString > *, false >::operator=(), and tArray< uSelectItem< tString > *, false >::tArray().
00096 { 00097 int i; 00098 for(i=Len()-1;i>=0;i--) 00099 new(reinterpret_cast<T *>(Base())+i) T(A(i)); 00100 for(i=Len();i<Size();i++) 00101 new(reinterpret_cast<T *>(Base())+i) T(); 00102 }
void tArray< T, MALLOC >::SetLen | ( | int | i | ) | [inline] |
Reimplemented from GrowingArrayBase.
Definition at line 105 of file tArray.h.
Referenced by gNetPlayerWall::BlowHole(), nSendBuffer::Clear(), ePath::Clear(), nNetObject::ClearAll(), eLineEntry::Delete(), gAISensor::DetectLoop(), ePlayerNetID::ePlayerNetID(), tDirectories::GetFiles(), tDirectories::GetSpecList(), gNetPlayerWall::InitArray(), tArray< uSelectItem< tString > *, false >::Insert(), nServerInfo::Load(), LoadSingleAI(), login_callback(), net_destroy_handler(), tArray< uSelectItem< tString > *, false >::operator=(), nMessage::operator>>(), tArray< uSelectItem< tString > *, false >::operator[](), tPathScripts::Paths(), tPathResource::Paths(), tPathScreenshot::Paths(), tPathVar::Paths(), tPathMusic::Paths(), tPathData::Paths(), tPathConfig::Paths(), gNetPlayerWall::ReadSync(), tSettingRotation::ReadVal(), gNetPlayerWall::real_Update(), tReferenceHolder< T >::ReleaseAll(), tReferenceHolder< T >::Remove(), tArray< uSelectItem< tString > *, false >::RemoveAt(), uMenu::ReverseItems(), se_DeletePasswords(), sn_DoDestroy(), st_DoToDo(), tXmlParserNamespace::st_ErrorFunc(), nBandwidthArbitrator::Timestep(), and tMemManager::tMemManager().
00105 { 00106 GrowingArrayBase::SetLen(i); 00107 if (i>Size()) resize(i); 00108 }
T& tArray< T, MALLOC >::operator[] | ( | int | i | ) | [inline] |
Definition at line 130 of file tArray.h.
00130 { 00131 #ifdef DEBUG 00132 if (i<0) { 00133 tERR_ERROR_INT("Range error;accesed negative element " << i ); 00134 } 00135 #endif 00136 if (i>=Len()) 00137 SetLen(i+1); 00138 00139 // dump(low,flow,"[" << i << "]" << "=" << ((T *)Base())[i] << '\n'); 00140 00141 return((reinterpret_cast<T *>(Base()))[i]); 00142 };
T const& tArray< T, MALLOC >::operator[] | ( | int | i | ) | const [inline] |
T& tArray< T, MALLOC >::operator() | ( | int | i | ) | const [inline] |
Reimplemented in tHeapBase, tHeap< T >, tHeap< nBandwidthArbitrator >, and tHeap< tEvent >.
Definition at line 151 of file tArray.h.
00151 { 00152 tASSERT( i >= 0 && i < Len() ); 00153 00154 return((reinterpret_cast<T *>(Base()))[i]); 00155 };
T* tArray< T, MALLOC >::operator+ | ( | int | i | ) | const [inline] |
Definition at line 157 of file tArray.h.
00157 { 00158 #ifdef DEBUG 00159 if (i<0) {tERR_ERROR_INT("Range error;accesed negative element " << i )} 00160 if (i>=Len()) 00161 {tERR_ERROR_INT("Range error;accesed element " 00162 << i <<" of maximal " <<Len())} 00163 #endif 00164 00165 return(reinterpret_cast<T *>(Base())+i); 00166 };
void tArray< T, MALLOC >::RemoveAt | ( | int | index | ) | [inline] |
Definition at line 177 of file tArray.h.
Referenced by tArray< uSelectItem< tString > *, false >::Remove().
00178 { 00179 int newLen = this->Len()-1; 00180 T keep = (*this)[ index ]; 00181 if ( index < newLen ) 00182 (*this)[ index ] = (*this)[ newLen ]; 00183 this->SetLen( newLen ); 00184 }
bool tArray< T, MALLOC >::Remove | ( | const T & | t | ) | [inline] |
void tArray< T, MALLOC >::Insert | ( | const T & | t | ) | [inline] |
Definition at line 200 of file tArray.h.
Referenced by eVoteItem::GetControlMessage(), and tSettingRotation::ReadVal().