added member function that returns the number of entries installed
This commit is contained in:
@@ -160,6 +160,8 @@ public:
|
||||
void traverse ( pSetMFArg(pCB) );
|
||||
void traverseConst ( pSetMFArgConst(pCB) ) const;
|
||||
|
||||
unsigned numEntriesInstalled () const
|
||||
|
||||
private:
|
||||
tsSLList<T> *pTable;
|
||||
unsigned hashIdMask;
|
||||
@@ -338,7 +340,6 @@ resTable<T,ID>::resTable ( unsigned nHashTableEntries ) :
|
||||
|
||||
this->hashIdNBits = nbits;
|
||||
this->hashIdMask = mask;
|
||||
this->nInUse = 0u;
|
||||
this->pTable = new tsSLList<T> [1<<nbits];
|
||||
if (this->pTable==0) {
|
||||
throwWithLocation ( dynamicMemoryAllocationFailed () );
|
||||
@@ -468,6 +469,12 @@ void resTable<T,ID>::traverseConst (pSetMFArgConst(pCB)) const
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class ID>
|
||||
inline void resTable<T,ID>::numEntriesInstalled () const
|
||||
{
|
||||
return this->nInUse;
|
||||
}
|
||||
|
||||
//
|
||||
// add a res to the resTable
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user