diff --git a/headers/private/shared/HashMap.h b/headers/private/shared/HashMap.h index 8edbba306b..b55e0d98d9 100644 --- a/headers/private/shared/HashMap.h +++ b/headers/private/shared/HashMap.h @@ -28,12 +28,13 @@ #ifndef HASH_MAP_H #define HASH_MAP_H -//#include + #include #include "AutoLocker.h" #include "OpenHashTable.h" + namespace BPrivate { // HashMapElement @@ -107,7 +108,17 @@ public: _FindNext(); return result; } - + + Value* NextValue() + { + if (fElement == NULL) + return NULL; + + Value* value = &fElement->fValue; + _FindNext(); + return value; + } + Entry Remove() { if (!fLastElement) @@ -169,6 +180,7 @@ public: Value Remove(const Key& key); void Clear(); Value Get(const Key& key) const; + bool Get(const Key& key, Value*& _value) const; bool ContainsKey(const Key& key) const; @@ -404,6 +416,19 @@ HashMap::Get(const Key& key) const return Value(); } +// Get +template +bool +HashMap::Get(const Key& key, Value*& _value) const +{ + if (Element* element = _FindElement(key)) { + _value = &element->fValue; + return true; + } + + return false; +} + // ContainsKey template bool