diff --git a/base/dictionary.cpp b/base/dictionary.cpp index c61fa72b9..7cbd59e32 100644 --- a/base/dictionary.cpp +++ b/base/dictionary.cpp @@ -26,7 +26,7 @@ using namespace icinga; * * @returns An iterator. */ -DictionaryIterator Dictionary::Begin(void) +Iterator Dictionary::Begin(void) { return m_Data.begin(); } @@ -36,7 +36,7 @@ DictionaryIterator Dictionary::Begin(void) * * @returns An iterator. */ -DictionaryIterator Dictionary::End(void) +Iterator Dictionary::End(void) { return m_Data.end(); } diff --git a/base/dictionary.h b/base/dictionary.h index 3515b2f4e..05687bffb 100644 --- a/base/dictionary.h +++ b/base/dictionary.h @@ -23,9 +23,6 @@ namespace icinga { -typedef map::const_iterator ConstDictionaryIterator; -typedef map::iterator DictionaryIterator; - /** * A container that holds key-value pairs. * @@ -37,6 +34,9 @@ public: typedef shared_ptr Ptr; typedef weak_ptr WeakPtr; + typedef map::const_iterator ConstIterator; + typedef map::iterator Iterator; + /** * Retrieves a value from the dictionary. * @@ -47,7 +47,7 @@ public: template bool GetProperty(const string& key, T *value) const { - ConstDictionaryIterator i = m_Data.find(key); + ConstIterator i = m_Data.find(key); if (i == m_Data.end()) return false; @@ -101,7 +101,7 @@ public: template void AddUnnamedProperty(const T& value) { - DictionaryIterator it; + Iterator it; string key; long index = GetLength(); do { @@ -118,8 +118,8 @@ public: bool Contains(const string& key) const; - DictionaryIterator Begin(void); - DictionaryIterator End(void); + Iterator Begin(void); + Iterator End(void); long GetLength(void) const; diff --git a/components/compat/compatcomponent.cpp b/components/compat/compatcomponent.cpp index 414026b9f..16ab38607 100644 --- a/components/compat/compatcomponent.cpp +++ b/components/compat/compatcomponent.cpp @@ -217,7 +217,7 @@ void CompatComponent::StatusTimerHandler(void) Host host = it->second; Dictionary::Ptr dict; - DictionaryIterator dt; + Dictionary::Iterator dt; dict = host.GetGroups(); @@ -258,7 +258,7 @@ void CompatComponent::StatusTimerHandler(void) Service service = it->second; Dictionary::Ptr dict; - DictionaryIterator dt; + Dictionary::Iterator dt; dict = service.GetGroups(); diff --git a/jsonrpc/messagepart.cpp b/jsonrpc/messagepart.cpp index 0f1cf1f11..d2cb6881e 100644 --- a/jsonrpc/messagepart.cpp +++ b/jsonrpc/messagepart.cpp @@ -112,7 +112,7 @@ json_t *MessagePart::GetJsonFromDictionary(const Dictionary::Ptr& dictionary) json = cJSON_CreateObject(); - for (DictionaryIterator i = dictionary->Begin(); i != dictionary->End(); i++) { + for (Dictionary::Iterator i = dictionary->Begin(); i != dictionary->End(); i++) { switch (i->second.GetType()) { case VariantInteger: cJSON_AddNumberToObject(json, i->first.c_str(), i->second.GetInteger()); @@ -217,7 +217,7 @@ void MessagePart::AddUnnamedProperty(const MessagePart& value) * * @returns An iterator. */ -DictionaryIterator MessagePart::Begin(void) +Dictionary::Iterator MessagePart::Begin(void) { return GetDictionary()->Begin(); } @@ -228,7 +228,7 @@ DictionaryIterator MessagePart::Begin(void) * * @returns An iterator. */ -DictionaryIterator MessagePart::End(void) +Dictionary::Iterator MessagePart::End(void) { return GetDictionary()->End(); } diff --git a/jsonrpc/messagepart.h b/jsonrpc/messagepart.h index 82d76d330..80554cabf 100644 --- a/jsonrpc/messagepart.h +++ b/jsonrpc/messagepart.h @@ -87,8 +87,8 @@ public: bool Contains(const string& key) const; - DictionaryIterator Begin(void); - DictionaryIterator End(void); + Dictionary::Iterator Begin(void); + Dictionary::Iterator End(void); private: Dictionary::Ptr m_Dictionary;