iterall for HashTable

This commit is contained in:
Eliot Horowitz
2010-01-15 16:11:00 -05:00
parent 02e33dafc0
commit 4539b8e7c5

View File

@@ -141,7 +141,17 @@ namespace mongo {
nodes[i].value = value;
return true;
}
typedef void (*IteratorCallback)( const Key& k , Type& v );
void iterall( IteratorCallback callback ){
for ( int i=0; i<n; i++ ){
if ( ! nodes[i].inUse() )
continue;
callback( nodes[i].k , nodes[i].value );
}
}
};
#pragma pack()