added member function that returns the number of entries installed

This commit is contained in:
Jeff Hill
2001-01-31 02:00:21 +00:00
parent 1bb85f670c
commit 855f1afc9d

View File

@@ -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
//