template ZArray::ZArray() : mMaxNbEntries(0), mCurNbEntries(0), mEntries(NULL) { #ifdef LIB3D_X11_DEBUG SCOL_X11_DEBUG("ZArray::ZArray"); #endif } template ZArray::~ZArray() { #ifdef LIB3D_X11_DEBUG SCOL_X11_DEBUG("ZArray::~ZArray"); #endif DELETEARRAY(mEntries); } template bool ZArray::Resize() { #ifdef LIB3D_X11_DEBUG SCOL_X11_DEBUG("ZArray::Resize"); #endif // Get twice as many entries as before mMaxNbEntries = mMaxNbEntries ? (mMaxNbEntries<<1) : 2; // Default nb Entries = 2 // Get some bytes for new entries T* NewEntries = new T[mMaxNbEntries]; CHECKALLOC(NewEntries); // Copy old data if needed if(mCurNbEntries) //CopyMemory(NewEntries, mEntries, mCurNbEntries*sizeof(T)); { for(int k=0; k bool ZArray::Contains(T entry, int* location) const { #ifdef LIB3D_X11_DEBUG SCOL_X11_DEBUG("ZArray::Contains"); #endif // Look for the entry for(int i=0;i bool ZArray::Delete(T entry) { #ifdef LIB3D_X11_DEBUG SCOL_X11_DEBUG("ZArray::Delete"); #endif // Look for the entry for(int i=0;i int ZArray::GetUsedRam() const { #ifdef LIB3D_X11_DEBUG SCOL_X11_DEBUG("ZArray::GetUsedRam"); #endif return sizeof(ZArray) + mMaxNbEntries * sizeof(T); }