headers/private/kernel/util/OpenHashTable.h, Hugo's version, is a bit nicer than

Tracker's OpenHashTable.h which it should eventually replace. We've renamed the
class to BOpenHashTable and changed the interface slightly so that HashTableLink
became superfluous.
Adapted all the code that used it. Since the OpenHashTables no longer clash,
this should fix the GCC4 build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31791 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2009-07-27 00:39:12 +00:00
parent 8e1857f795
commit 5147963dcd
59 changed files with 346 additions and 311 deletions
+9 -7
View File
@@ -15,7 +15,7 @@
// HashMapElement
template<typename Key, typename Value>
class HashMapElement : public HashTableLink<HashMapElement<Key, Value> > {
class HashMapElement {
private:
typedef HashMapElement<Key, Value> Element;
@@ -34,8 +34,9 @@ public:
{
}
Key fKey;
Value fValue;
Key fKey;
Value fValue;
HashMapElement* fNext;
};
@@ -51,8 +52,8 @@ struct HashMapTableDefinition {
{ return HashKey(value->fKey); }
bool Compare(const KeyType& key, const ValueType* value) const
{ return value->fKey == key; }
HashTableLink<ValueType>* GetLink(ValueType* value) const
{ return value; }
ValueType*& GetLink(ValueType* value) const
{ return value->fNext; }
};
@@ -128,7 +129,8 @@ public:
private:
friend class HashMap<Key, Value>;
typedef OpenHashTable<HashMapTableDefinition<Key, Value> > ElementTable;
typedef BOpenHashTable<HashMapTableDefinition<Key, Value> >
ElementTable;
HashMap<Key, Value>* fMap;
typename ElementTable::Iterator fIterator;
@@ -152,7 +154,7 @@ public:
Iterator GetIterator();
protected:
typedef OpenHashTable<HashMapTableDefinition<Key, Value> > ElementTable;
typedef BOpenHashTable<HashMapTableDefinition<Key, Value> > ElementTable;
typedef HashMapElement<Key, Value> Element;
friend class Iterator;