12 #ifndef __ICECONTAINER_H__ 13 #define __ICECONTAINER_H__ 15 #define CONTAINER_STATS 50 if(mCurNbEntries==mMaxNbEntries) Resize();
53 mEntries[mCurNbEntries++] = entry;
60 if(mCurNbEntries+nb>mMaxNbEntries) Resize(nb);
84 if(mCurNbEntries==mMaxNbEntries) Resize();
87 mEntries[mCurNbEntries++] =
IR(entry);
94 if(mCurNbEntries+nb>mMaxNbEntries) Resize(nb);
97 CopyMemory(&mEntries[mCurNbEntries], entries, nb*
sizeof(
float));
105 if(!Contains(entry)) Add(entry);
129 if(mCurNbEntries) mCurNbEntries = 0;
135 mCurNbEntries =
size;
160 bool DeleteKeepingOrder(
udword entry);
189 udword GetUsedRam()
const;
194 #ifdef CONTAINER_STATS 204 bool Resize(
udword needed=1);
212 #endif // __ICECONTAINER_H__ #define IR(x)
Integer representation of a floating-point value.
static udword mNbContainers
Number of containers around.
inline_ Container & AddUnique(udword entry)
Add unique [slow].
inline_ void SetGrowthFactor(float growth)
Sets the growth factor.
#define null
our own NULL pointer
static udword mUsedRam
Amount of bytes used by containers in the system.
inline_ void ForceSize(udword size)
inline_ bool IsFull() const
Checks the container is full.
inline_ BOOL IsNotEmpty() const
Checks the container is empty.
inline_ udword GetLast() const
inline_ void DeleteLastEntry()
Deletes the very last entry.
inline_ udword GetTotalBytes() const
udword * mEntries
List of entries.
int BOOL
Another boolean type.
unsigned int udword
sizeof(udword) must be 4
inline_ udword operator[](udword i) const
Read-access as an array.
void Delete(RTObject_impl *rtc)
inline_ void DeleteIndex(udword index)
Deletes the entry whose index is given.
udword mCurNbEntries
Current number of entries.
png_infop int int location
inline_ udword GetNbContainers() const
Operator for "Container A = Container B".
png_infop png_sPLT_tpp entries
inline_ Container & Add(const udword *entries, udword nb)
float mGrowthFactor
Resize: new number of entries = old number * mGrowthFactor.
inline_ void CopyMemory(void *dest, const void *src, udword size)
inline_ Container & Add(const float *entries, udword nb)
inline_ udword GetNbEntries() const
Returns the current number of entries.
inline_ udword GetEntry(udword i) const
Returns ith entry.
inline_ udword * GetEntries() const
Returns the list of entries.
inline_ float GetGrowthFactor() const
Returns the growth factor.
udword mMaxNbEntries
Maximum possible number of entries.
inline_ udword GetFirst() const
inline_ udword & operator[](udword i)
Write-access as an array.