2019-02-13 06:44:14 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2004-2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
2019-02-13 06:46:28 +03:00
|
|
|
* Copyright 2019, Haiku, Inc. All rights reserved.
|
2019-02-13 06:44:14 +03:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2007-08-02 20:28:34 +04:00
|
|
|
#ifndef HASH_MAP_H
|
|
|
|
#define HASH_MAP_H
|
|
|
|
|
2019-02-13 06:46:28 +03:00
|
|
|
#include <OpenHashTable.h>
|
|
|
|
#include <Locker.h>
|
2007-08-02 20:28:34 +04:00
|
|
|
|
|
|
|
#include "AutoLocker.h"
|
2019-02-13 06:46:28 +03:00
|
|
|
|
|
|
|
|
|
|
|
namespace BPrivate {
|
2009-08-06 13:42:34 +04:00
|
|
|
|
2007-08-02 20:28:34 +04:00
|
|
|
|
|
|
|
// HashMapElement
|
|
|
|
template<typename Key, typename Value>
|
2019-02-13 06:44:14 +03:00
|
|
|
class HashMapElement {
|
2007-08-02 20:28:34 +04:00
|
|
|
private:
|
|
|
|
typedef HashMapElement<Key, Value> Element;
|
|
|
|
|
2019-02-13 06:44:14 +03:00
|
|
|
public:
|
|
|
|
HashMapElement()
|
|
|
|
:
|
|
|
|
fKey(),
|
|
|
|
fValue(),
|
|
|
|
fNext(NULL)
|
2007-08-02 20:28:34 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-02-13 06:44:14 +03:00
|
|
|
HashMapElement(const Key& key, const Value& value)
|
|
|
|
:
|
|
|
|
fKey(key),
|
|
|
|
fValue(value),
|
|
|
|
fNext(NULL)
|
2007-08-02 20:28:34 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-02-13 06:44:14 +03:00
|
|
|
Key fKey;
|
|
|
|
Value fValue;
|
|
|
|
HashMapElement* fNext;
|
|
|
|
};
|
2007-08-02 20:28:34 +04:00
|
|
|
|
|
|
|
|
2019-02-13 06:44:14 +03:00
|
|
|
// HashMapTableDefinition
|
|
|
|
template<typename Key, typename Value>
|
|
|
|
struct HashMapTableDefinition {
|
|
|
|
typedef Key KeyType;
|
|
|
|
typedef HashMapElement<Key, Value> ValueType;
|
|
|
|
|
|
|
|
size_t HashKey(const KeyType& key) const
|
|
|
|
{ return key.GetHashCode(); }
|
|
|
|
size_t Hash(const ValueType* value) const
|
|
|
|
{ return HashKey(value->fKey); }
|
|
|
|
bool Compare(const KeyType& key, const ValueType* value) const
|
|
|
|
{ return value->fKey == key; }
|
|
|
|
ValueType*& GetLink(ValueType* value) const
|
|
|
|
{ return value->fNext; }
|
2007-08-02 20:28:34 +04:00
|
|
|
};
|
|
|
|
|
2019-02-13 06:44:14 +03:00
|
|
|
|
2007-08-02 20:28:34 +04:00
|
|
|
// HashMap
|
|
|
|
template<typename Key, typename Value>
|
|
|
|
class HashMap {
|
|
|
|
public:
|
|
|
|
class Entry {
|
|
|
|
public:
|
|
|
|
Entry() {}
|
|
|
|
Entry(const Key& key, Value value) : key(key), value(value) {}
|
|
|
|
|
|
|
|
Key key;
|
|
|
|
Value value;
|
|
|
|
};
|
|
|
|
|
|
|
|
class Iterator {
|
|
|
|
private:
|
|
|
|
typedef HashMapElement<Key, Value> Element;
|
|
|
|
public:
|
|
|
|
Iterator(const Iterator& other)
|
2010-01-15 00:49:53 +03:00
|
|
|
:
|
|
|
|
fMap(other.fMap),
|
2019-02-13 06:44:14 +03:00
|
|
|
fIterator(other.fIterator),
|
|
|
|
fElement(other.fElement)
|
2007-08-02 20:28:34 +04:00
|
|
|
{
|
|
|
|
}
|
2010-01-15 00:49:53 +03:00
|
|
|
|
2007-08-02 20:28:34 +04:00
|
|
|
bool HasNext() const
|
|
|
|
{
|
2019-02-13 06:44:14 +03:00
|
|
|
return fIterator.HasNext();
|
2007-08-02 20:28:34 +04:00
|
|
|
}
|
2010-01-15 00:49:53 +03:00
|
|
|
|
2007-08-02 20:28:34 +04:00
|
|
|
Entry Next()
|
|
|
|
{
|
2019-02-13 06:44:14 +03:00
|
|
|
fElement = fIterator.Next();
|
2009-08-06 13:42:34 +04:00
|
|
|
if (fElement == NULL)
|
2019-02-13 06:44:14 +03:00
|
|
|
return Entry();
|
2010-01-15 00:49:53 +03:00
|
|
|
|
2019-02-13 06:44:14 +03:00
|
|
|
return Entry(fElement->fKey, fElement->fValue);
|
2009-08-06 13:42:34 +04:00
|
|
|
}
|
|
|
|
|
2007-08-02 20:28:34 +04:00
|
|
|
Iterator& operator=(const Iterator& other)
|
|
|
|
{
|
|
|
|
fMap = other.fMap;
|
2019-02-13 06:44:14 +03:00
|
|
|
fIterator = other.fIterator;
|
2007-08-02 20:28:34 +04:00
|
|
|
fElement = other.fElement;
|
|
|
|
return *this;
|
|
|
|
}
|
2010-01-15 00:49:53 +03:00
|
|
|
|
2007-08-02 20:28:34 +04:00
|
|
|
private:
|
2019-02-13 06:46:28 +03:00
|
|
|
Iterator(const HashMap<Key, Value>* map)
|
2010-01-15 00:49:53 +03:00
|
|
|
:
|
2019-02-13 06:44:14 +03:00
|
|
|
fMap(map),
|
|
|
|
fIterator(map->fTable.GetIterator()),
|
|
|
|
fElement(NULL)
|
2007-08-02 20:28:34 +04:00
|
|
|
{
|
|
|
|
}
|
2010-01-15 00:49:53 +03:00
|
|
|
|
2007-08-02 20:28:34 +04:00
|
|
|
private:
|
|
|
|
friend class HashMap<Key, Value>;
|
2019-02-13 06:44:14 +03:00
|
|
|
typedef BOpenHashTable<HashMapTableDefinition<Key, Value> >
|
|
|
|
ElementTable;
|
2010-01-15 00:49:53 +03:00
|
|
|
|
2019-02-13 06:46:28 +03:00
|
|
|
const HashMap<Key, Value>* fMap;
|
2019-02-13 06:44:14 +03:00
|
|
|
typename ElementTable::Iterator fIterator;
|
|
|
|
Element* fElement;
|
2007-08-02 20:28:34 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
HashMap();
|
|
|
|
~HashMap();
|
|
|
|
|
|
|
|
status_t InitCheck() const;
|
|
|
|
|
2019-02-13 06:44:14 +03:00
|
|
|
status_t Put(const Key& key, const Value& value);
|
2007-08-02 20:28:34 +04:00
|
|
|
Value Remove(const Key& key);
|
2019-02-13 06:46:28 +03:00
|
|
|
Value Remove(Iterator& it);
|
2007-08-02 20:28:34 +04:00
|
|
|
void Clear();
|
|
|
|
Value Get(const Key& key) const;
|
2019-02-13 06:46:28 +03:00
|
|
|
bool Get(const Key& key, Value*& _value) const;
|
2007-08-02 20:28:34 +04:00
|
|
|
|
|
|
|
bool ContainsKey(const Key& key) const;
|
|
|
|
|
|
|
|
int32 Size() const;
|
|
|
|
|
2019-02-13 06:46:28 +03:00
|
|
|
Iterator GetIterator() const;
|
2007-08-02 20:28:34 +04:00
|
|
|
|
|
|
|
protected:
|
2019-02-13 06:44:14 +03:00
|
|
|
typedef BOpenHashTable<HashMapTableDefinition<Key, Value> > ElementTable;
|
2007-08-02 20:28:34 +04:00
|
|
|
typedef HashMapElement<Key, Value> Element;
|
|
|
|
friend class Iterator;
|
|
|
|
|
|
|
|
protected:
|
2019-02-13 06:44:14 +03:00
|
|
|
ElementTable fTable;
|
2007-08-02 20:28:34 +04:00
|
|
|
};
|
|
|
|
|
2019-02-13 06:44:14 +03:00
|
|
|
|
2007-08-02 20:28:34 +04:00
|
|
|
// SynchronizedHashMap
|
2019-02-13 06:46:28 +03:00
|
|
|
template<typename Key, typename Value, typename Locker = BLocker>
|
2019-02-13 06:44:14 +03:00
|
|
|
class SynchronizedHashMap : public Locker {
|
2007-08-02 20:28:34 +04:00
|
|
|
public:
|
2019-02-13 06:44:14 +03:00
|
|
|
typedef typename HashMap<Key, Value>::Entry Entry;
|
|
|
|
typedef typename HashMap<Key, Value>::Iterator Iterator;
|
2007-08-02 20:28:34 +04:00
|
|
|
|
2019-02-13 06:44:14 +03:00
|
|
|
SynchronizedHashMap() : Locker("synchronized hash map") {}
|
2019-02-15 03:52:45 +03:00
|
|
|
~SynchronizedHashMap() { Locker::Lock(); }
|
2007-08-02 20:28:34 +04:00
|
|
|
|
|
|
|
status_t InitCheck() const
|
|
|
|
{
|
|
|
|
return fMap.InitCheck();
|
|
|
|
}
|
|
|
|
|
2019-02-13 06:44:14 +03:00
|
|
|
status_t Put(const Key& key, const Value& value)
|
2007-08-02 20:28:34 +04:00
|
|
|
{
|
|
|
|
MapLocker locker(this);
|
|
|
|
if (!locker.IsLocked())
|
|
|
|
return B_ERROR;
|
|
|
|
return fMap.Put(key, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
Value Remove(const Key& key)
|
|
|
|
{
|
|
|
|
MapLocker locker(this);
|
|
|
|
if (!locker.IsLocked())
|
|
|
|
return Value();
|
|
|
|
return fMap.Remove(key);
|
|
|
|
}
|
|
|
|
|
2019-02-15 03:52:45 +03:00
|
|
|
Value Remove(Iterator& it)
|
|
|
|
{
|
|
|
|
MapLocker locker(this);
|
|
|
|
if (!locker.IsLocked())
|
|
|
|
return Value();
|
|
|
|
return fMap.Remove(it);
|
|
|
|
}
|
|
|
|
|
2007-08-02 20:28:34 +04:00
|
|
|
void Clear()
|
|
|
|
{
|
|
|
|
MapLocker locker(this);
|
2012-08-16 23:18:58 +04:00
|
|
|
fMap.Clear();
|
2007-08-02 20:28:34 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
Value Get(const Key& key) const
|
|
|
|
{
|
2019-02-13 06:44:14 +03:00
|
|
|
const Locker* lock = this;
|
|
|
|
MapLocker locker(const_cast<Locker*>(lock));
|
2007-08-02 20:28:34 +04:00
|
|
|
if (!locker.IsLocked())
|
|
|
|
return Value();
|
|
|
|
return fMap.Get(key);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool ContainsKey(const Key& key) const
|
|
|
|
{
|
2019-02-13 06:44:14 +03:00
|
|
|
const Locker* lock = this;
|
|
|
|
MapLocker locker(const_cast<Locker*>(lock));
|
2007-08-02 20:28:34 +04:00
|
|
|
if (!locker.IsLocked())
|
|
|
|
return false;
|
|
|
|
return fMap.ContainsKey(key);
|
|
|
|
}
|
|
|
|
|
|
|
|
int32 Size() const
|
|
|
|
{
|
2019-02-13 06:44:14 +03:00
|
|
|
const Locker* lock = this;
|
|
|
|
MapLocker locker(const_cast<Locker*>(lock));
|
2007-08-02 20:28:34 +04:00
|
|
|
return fMap.Size();
|
|
|
|
}
|
|
|
|
|
|
|
|
Iterator GetIterator()
|
|
|
|
{
|
|
|
|
return fMap.GetIterator();
|
|
|
|
}
|
|
|
|
|
|
|
|
// for debugging only
|
|
|
|
const HashMap<Key, Value>& GetUnsynchronizedMap() const { return fMap; }
|
|
|
|
HashMap<Key, Value>& GetUnsynchronizedMap() { return fMap; }
|
|
|
|
|
|
|
|
protected:
|
2019-02-13 06:44:14 +03:00
|
|
|
typedef AutoLocker<Locker> MapLocker;
|
2007-08-02 20:28:34 +04:00
|
|
|
|
|
|
|
HashMap<Key, Value> fMap;
|
|
|
|
};
|
|
|
|
|
|
|
|
// HashKey32
|
|
|
|
template<typename Value>
|
|
|
|
struct HashKey32 {
|
|
|
|
HashKey32() {}
|
|
|
|
HashKey32(const Value& value) : value(value) {}
|
|
|
|
|
|
|
|
uint32 GetHashCode() const
|
|
|
|
{
|
|
|
|
return (uint32)value;
|
|
|
|
}
|
|
|
|
|
|
|
|
HashKey32<Value> operator=(const HashKey32<Value>& other)
|
|
|
|
{
|
|
|
|
value = other.value;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool operator==(const HashKey32<Value>& other) const
|
|
|
|
{
|
|
|
|
return (value == other.value);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool operator!=(const HashKey32<Value>& other) const
|
|
|
|
{
|
|
|
|
return (value != other.value);
|
|
|
|
}
|
|
|
|
|
|
|
|
Value value;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// HashKey64
|
|
|
|
template<typename Value>
|
|
|
|
struct HashKey64 {
|
|
|
|
HashKey64() {}
|
|
|
|
HashKey64(const Value& value) : value(value) {}
|
|
|
|
|
|
|
|
uint32 GetHashCode() const
|
|
|
|
{
|
|
|
|
uint64 v = (uint64)value;
|
|
|
|
return (uint32)(v >> 32) ^ (uint32)v;
|
|
|
|
}
|
|
|
|
|
|
|
|
HashKey64<Value> operator=(const HashKey64<Value>& other)
|
|
|
|
{
|
|
|
|
value = other.value;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool operator==(const HashKey64<Value>& other) const
|
|
|
|
{
|
|
|
|
return (value == other.value);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool operator!=(const HashKey64<Value>& other) const
|
|
|
|
{
|
|
|
|
return (value != other.value);
|
|
|
|
}
|
|
|
|
|
|
|
|
Value value;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2019-02-13 06:44:14 +03:00
|
|
|
// HashKeyPointer
|
|
|
|
template<typename Value>
|
|
|
|
struct HashKeyPointer {
|
|
|
|
HashKeyPointer() {}
|
|
|
|
HashKeyPointer(const Value& value) : value(value) {}
|
|
|
|
|
|
|
|
uint32 GetHashCode() const
|
|
|
|
{
|
|
|
|
#if __HAIKU_ARCH_BITS == 32
|
|
|
|
return (uint32)(addr_t)value;
|
|
|
|
#elif __HAIKU_ARCH_BITS == 64
|
|
|
|
uint64 v = (uint64)(addr_t)value;
|
|
|
|
return (uint32)(v >> 32) ^ (uint32)v;
|
|
|
|
#else
|
|
|
|
#error unknown bitness
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
HashKeyPointer<Value> operator=(const HashKeyPointer<Value>& other)
|
|
|
|
{
|
|
|
|
value = other.value;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool operator==(const HashKeyPointer<Value>& other) const
|
|
|
|
{
|
|
|
|
return (value == other.value);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool operator!=(const HashKeyPointer<Value>& other) const
|
|
|
|
{
|
|
|
|
return (value != other.value);
|
|
|
|
}
|
|
|
|
|
|
|
|
Value value;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-08-02 20:28:34 +04:00
|
|
|
// HashMap
|
|
|
|
|
|
|
|
// constructor
|
|
|
|
template<typename Key, typename Value>
|
|
|
|
HashMap<Key, Value>::HashMap()
|
2010-01-15 00:49:53 +03:00
|
|
|
:
|
2019-02-13 06:44:14 +03:00
|
|
|
fTable()
|
2007-08-02 20:28:34 +04:00
|
|
|
{
|
2019-02-13 06:44:14 +03:00
|
|
|
fTable.Init();
|
2007-08-02 20:28:34 +04:00
|
|
|
}
|
|
|
|
|
2019-02-13 06:44:14 +03:00
|
|
|
|
2007-08-02 20:28:34 +04:00
|
|
|
// destructor
|
|
|
|
template<typename Key, typename Value>
|
|
|
|
HashMap<Key, Value>::~HashMap()
|
|
|
|
{
|
2019-02-13 06:44:14 +03:00
|
|
|
Clear();
|
2007-08-02 20:28:34 +04:00
|
|
|
}
|
|
|
|
|
2019-02-13 06:44:14 +03:00
|
|
|
|
2007-08-02 20:28:34 +04:00
|
|
|
// InitCheck
|
|
|
|
template<typename Key, typename Value>
|
|
|
|
status_t
|
|
|
|
HashMap<Key, Value>::InitCheck() const
|
|
|
|
{
|
2019-02-13 06:44:14 +03:00
|
|
|
return (fTable.TableSize() > 0 ? B_OK : B_NO_MEMORY);
|
2007-08-02 20:28:34 +04:00
|
|
|
}
|
|
|
|
|
2019-02-13 06:44:14 +03:00
|
|
|
|
2007-08-02 20:28:34 +04:00
|
|
|
// Put
|
|
|
|
template<typename Key, typename Value>
|
|
|
|
status_t
|
2019-02-13 06:44:14 +03:00
|
|
|
HashMap<Key, Value>::Put(const Key& key, const Value& value)
|
2007-08-02 20:28:34 +04:00
|
|
|
{
|
2019-02-13 06:44:14 +03:00
|
|
|
Element* element = fTable.Lookup(key);
|
2007-08-02 20:28:34 +04:00
|
|
|
if (element) {
|
|
|
|
// already contains the key: just set the new value
|
|
|
|
element->fValue = value;
|
|
|
|
return B_OK;
|
|
|
|
}
|
2019-02-13 06:44:14 +03:00
|
|
|
|
|
|
|
// does not contain the key yet: create an element and add it
|
|
|
|
element = new(std::nothrow) Element(key, value);
|
2007-08-02 20:28:34 +04:00
|
|
|
if (!element)
|
|
|
|
return B_NO_MEMORY;
|
2019-02-13 06:44:14 +03:00
|
|
|
|
|
|
|
status_t error = fTable.Insert(element);
|
|
|
|
if (error != B_OK)
|
|
|
|
delete element;
|
|
|
|
|
|
|
|
return error;
|
2007-08-02 20:28:34 +04:00
|
|
|
}
|
|
|
|
|
2019-02-13 06:44:14 +03:00
|
|
|
|
2007-08-02 20:28:34 +04:00
|
|
|
// Remove
|
|
|
|
template<typename Key, typename Value>
|
|
|
|
Value
|
|
|
|
HashMap<Key, Value>::Remove(const Key& key)
|
|
|
|
{
|
2019-02-13 06:44:14 +03:00
|
|
|
Element* element = fTable.Lookup(key);
|
|
|
|
if (element == NULL)
|
|
|
|
return Value();
|
|
|
|
|
|
|
|
fTable.Remove(element);
|
|
|
|
Value value = element->fValue;
|
|
|
|
delete element;
|
|
|
|
|
2007-08-02 20:28:34 +04:00
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
2019-02-13 06:44:14 +03:00
|
|
|
|
2019-02-13 06:46:28 +03:00
|
|
|
// Remove
|
|
|
|
template<typename Key, typename Value>
|
|
|
|
Value
|
|
|
|
HashMap<Key, Value>::Remove(Iterator& it)
|
|
|
|
{
|
|
|
|
Element* element = it.fElement;
|
|
|
|
if (element == NULL)
|
|
|
|
return Value();
|
|
|
|
|
|
|
|
Value value = element->fValue;
|
|
|
|
|
|
|
|
fTable.RemoveUnchecked(element);
|
|
|
|
delete element;
|
|
|
|
it.fElement = NULL;
|
|
|
|
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-02 20:28:34 +04:00
|
|
|
// Clear
|
|
|
|
template<typename Key, typename Value>
|
|
|
|
void
|
|
|
|
HashMap<Key, Value>::Clear()
|
|
|
|
{
|
2019-02-13 06:44:14 +03:00
|
|
|
// clear the table and delete the elements
|
|
|
|
Element* element = fTable.Clear(true);
|
|
|
|
while (element != NULL) {
|
|
|
|
Element* next = element->fNext;
|
|
|
|
delete element;
|
|
|
|
element = next;
|
|
|
|
}
|
2007-08-02 20:28:34 +04:00
|
|
|
}
|
|
|
|
|
2019-02-13 06:44:14 +03:00
|
|
|
|
2007-08-02 20:28:34 +04:00
|
|
|
// Get
|
|
|
|
template<typename Key, typename Value>
|
|
|
|
Value
|
|
|
|
HashMap<Key, Value>::Get(const Key& key) const
|
|
|
|
{
|
2019-02-13 06:44:14 +03:00
|
|
|
if (Element* element = fTable.Lookup(key))
|
2007-08-02 20:28:34 +04:00
|
|
|
return element->fValue;
|
|
|
|
return Value();
|
|
|
|
}
|
|
|
|
|
2009-08-06 13:42:34 +04:00
|
|
|
|
2019-02-13 06:46:28 +03:00
|
|
|
// Get
|
|
|
|
template<typename Key, typename Value>
|
|
|
|
bool
|
|
|
|
HashMap<Key, Value>::Get(const Key& key, Value*& _value) const
|
|
|
|
{
|
|
|
|
if (Element* element = fTable.Lookup(key)) {
|
|
|
|
_value = &element->fValue;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-02 20:28:34 +04:00
|
|
|
// ContainsKey
|
|
|
|
template<typename Key, typename Value>
|
|
|
|
bool
|
|
|
|
HashMap<Key, Value>::ContainsKey(const Key& key) const
|
|
|
|
{
|
2019-02-13 06:44:14 +03:00
|
|
|
return fTable.Lookup(key) != NULL;
|
2007-08-02 20:28:34 +04:00
|
|
|
}
|
|
|
|
|
2019-02-13 06:44:14 +03:00
|
|
|
|
2007-08-02 20:28:34 +04:00
|
|
|
// Size
|
|
|
|
template<typename Key, typename Value>
|
|
|
|
int32
|
|
|
|
HashMap<Key, Value>::Size() const
|
|
|
|
{
|
|
|
|
return fTable.CountElements();
|
|
|
|
}
|
|
|
|
|
2019-02-13 06:44:14 +03:00
|
|
|
|
2007-08-02 20:28:34 +04:00
|
|
|
// GetIterator
|
|
|
|
template<typename Key, typename Value>
|
2019-02-13 06:44:14 +03:00
|
|
|
typename HashMap<Key, Value>::Iterator
|
2019-02-13 06:46:28 +03:00
|
|
|
HashMap<Key, Value>::GetIterator() const
|
2007-08-02 20:28:34 +04:00
|
|
|
{
|
|
|
|
return Iterator(this);
|
|
|
|
}
|
|
|
|
|
2019-02-13 06:46:28 +03:00
|
|
|
} // namespace BPrivate
|
|
|
|
|
|
|
|
using BPrivate::HashMap;
|
|
|
|
using BPrivate::HashKey32;
|
|
|
|
using BPrivate::HashKey64;
|
|
|
|
using BPrivate::HashKeyPointer;
|
|
|
|
using BPrivate::SynchronizedHashMap;
|
2007-08-02 20:28:34 +04:00
|
|
|
|
|
|
|
#endif // HASH_MAP_H
|