12#ifndef TT_INCLUDE__HASHTEMPLATEITERATOR_H
13#define TT_INCLUDE__HASHTEMPLATEITERATOR_H
17#include "HashTemplateClass.h"
21template<
typename Key,
typename Value>
class HashTemplateIterator
28 HashTemplateClass<Key, Value>* table;
33 index = table->entries[index].next;
36 for (hash++; hash < table->maxHashCount; hash++)
38 index = table->indices[hash];
51 HashTemplateIterator(HashTemplateClass<Key, Value>& _table)
63 for (hash = 0; hash < table->maxHashCount; hash++)
65 index = table->indices[hash];
75 const Key &k = getKey();
82 const Key& getKey() {
return table->entries[index].key; }
83 Value& getValue() {
return table->entries[index].value; }
85 void operator++() { increment(); }
86 operator bool()
const {
return index != -1; }