42template <
class Object,
class Key>
class NamedObjectHashTableClass
47 HashTableClass(
int initialsize,
int growthrate,HashCalculatorClass<Key> * hasher);
48 ~HashTableClass(
void);
50 void Add(Object * new_item,Key * key);
51 void Remove(Object * item,Key * key);
53 int Count(
void)
const {
return Items.Count(); }
54 Object * Find(
const Key & key)
const
58 enum { NO_ITEM = 0xFFFFFFFF };
66 bool operator == (
const HashItem & that) {
return ((Item == that.Item) && (NextHashIndex == that.NextHashIndex)); }
67 bool operator != (
const HashItem & that) {
return !(*
this == that); }
71 DynamicVectorClass<HashItem> Items;
78 HashCalculatorClass<T> * HashCalculator;
80 friend class VectorClass;
81 friend class DynamicVectorClass;
86template <
class Object,
class Key>
97template <
class Object,
class Key>
103template <
class Object,
class Key>
107 HashCalculator->Compute_Hash(key);
108 int hashval = HashCalculator->Get_Hash_Value(0);
111 int test_item_index = HashTable[hash];
112 while (test_item_index != 0xFFFFFFFF) {
113 if (HashCalculator->Items_Match(Items[test_item_index].Item,new_item)) {
114 return Items[test_item_index].Object;
116 test_item_index = Items[test_item_index].NextHashIndex;
Bool operator!=(const AsciiString &s1, const AsciiString &s2)
Bool operator==(const AsciiString &s1, const AsciiString &s2)
WWINLINE Matrix4x4 Add(const Matrix4x4 &a, const Matrix4x4 &b)
HashableClass * Find(const char *key)