]> granicus.if.org Git - icinga2/commitdiff
Renamed DictionaryIterator to Dictionary::Iterator.
authorGunnar Beutner <gunnar@beutner.name>
Sat, 30 Jun 2012 13:22:51 +0000 (15:22 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Sat, 30 Jun 2012 13:22:51 +0000 (15:22 +0200)
base/dictionary.cpp
base/dictionary.h
components/compat/compatcomponent.cpp
jsonrpc/messagepart.cpp
jsonrpc/messagepart.h

index c61fa72b9de4554f18a893115ddea8dbfd06b05b..7cbd59e32ba176604d791c8ede7e2d7e22466224 100644 (file)
@@ -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();
 }
index 3515b2f4e2681c68ba4ad14599d101f1f8bdbdf5..05687bffb8cf92a83fa68893e37474b12dadc8f8 100644 (file)
@@ -23,9 +23,6 @@
 namespace icinga
 {
 
-typedef map<string, Variant>::const_iterator ConstDictionaryIterator;
-typedef map<string, Variant>::iterator DictionaryIterator;
-
 /**
  * A container that holds key-value pairs.
  *
@@ -37,6 +34,9 @@ public:
        typedef shared_ptr<Dictionary> Ptr;
        typedef weak_ptr<Dictionary> WeakPtr;
 
+       typedef map<string, Variant>::const_iterator ConstIterator;
+       typedef map<string, Variant>::iterator Iterator;
+
        /**
         * Retrieves a value from the dictionary.
         *
@@ -47,7 +47,7 @@ public:
        template<typename T>
        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<typename T>
        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;
 
index 414026b9f8dc36a7f5422eee2925040410e1902d..16ab3860798095a7a8be5bee35cd5c8749e95150 100644 (file)
@@ -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();
 
index 0f1cf1f11c0d8cf061c54e3209722fa59fc95c09..d2cb6881ef133562cd37cbd8395c1eaf5e17ef6f 100644 (file)
@@ -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();
 }
index 82d76d330a26dc4f627c7e24ced2c039f1c68190..80554cabfb87d1fa1432948a6edce525ced84bc1 100644 (file)
@@ -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;