improved show routine

This commit is contained in:
Jeff Hill
2002-07-11 15:27:35 +00:00
parent e490c2bc24
commit bc2763fc1a

View File

@@ -388,24 +388,25 @@ void resTable<T,ID>::show ( unsigned level ) const
{
const unsigned N = this->tableSize ();
printf ( "%u bucket hash table with %u items of type %s installed\n",
printf ( "Hash table with %u buckets and %u items of type %s installed\n",
N, this->nInUse, typeid(T).name() );
if ( N ) {
tsSLList<T> * pList = this->pTable;
while ( pList < & this->pTable[N] ) {
tsSLIter<T> pItem = pList->firstIter ();
while ( pItem.valid () ) {
tsSLIter<T> pNext = pItem;
pNext++;
pItem.pointer()->show ( level );
pItem = pNext;
}
pList++;
}
}
if ( level >= 1u && N ) {
if ( level >= 2u ) {
tsSLList<T> * pList = this->pTable;
while ( pList < & this->pTable[N] ) {
tsSLIter<T> pItem = pList->firstIter ();
while ( pItem.valid () ) {
tsSLIter<T> pNext = pItem;
pNext++;
pItem.pointer()->show ( level - 2u );
pItem = pNext;
}
pList++;
}
}
if ( level >=1u && N ) {
double X = 0.0;
double XX = 0.0;
unsigned maxEntries = 0u;