Renamed DictionaryIterator to Dictionary::Iterator.

This commit is contained in:
Gunnar Beutner 2012-06-30 15:22:51 +02:00
parent b576bb5ecc
commit 338e2bcbb1
5 changed files with 16 additions and 16 deletions

View File

@ -26,7 +26,7 @@ using namespace icinga;
* *
* @returns An iterator. * @returns An iterator.
*/ */
DictionaryIterator Dictionary::Begin(void) Iterator Dictionary::Begin(void)
{ {
return m_Data.begin(); return m_Data.begin();
} }
@ -36,7 +36,7 @@ DictionaryIterator Dictionary::Begin(void)
* *
* @returns An iterator. * @returns An iterator.
*/ */
DictionaryIterator Dictionary::End(void) Iterator Dictionary::End(void)
{ {
return m_Data.end(); return m_Data.end();
} }

View File

@ -23,9 +23,6 @@
namespace icinga namespace icinga
{ {
typedef map<string, Variant>::const_iterator ConstDictionaryIterator;
typedef map<string, Variant>::iterator DictionaryIterator;
/** /**
* A container that holds key-value pairs. * A container that holds key-value pairs.
* *
@ -37,6 +34,9 @@ public:
typedef shared_ptr<Dictionary> Ptr; typedef shared_ptr<Dictionary> Ptr;
typedef weak_ptr<Dictionary> WeakPtr; typedef weak_ptr<Dictionary> WeakPtr;
typedef map<string, Variant>::const_iterator ConstIterator;
typedef map<string, Variant>::iterator Iterator;
/** /**
* Retrieves a value from the dictionary. * Retrieves a value from the dictionary.
* *
@ -47,7 +47,7 @@ public:
template<typename T> template<typename T>
bool GetProperty(const string& key, T *value) const 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()) if (i == m_Data.end())
return false; return false;
@ -101,7 +101,7 @@ public:
template<typename T> template<typename T>
void AddUnnamedProperty(const T& value) void AddUnnamedProperty(const T& value)
{ {
DictionaryIterator it; Iterator it;
string key; string key;
long index = GetLength(); long index = GetLength();
do { do {
@ -118,8 +118,8 @@ public:
bool Contains(const string& key) const; bool Contains(const string& key) const;
DictionaryIterator Begin(void); Iterator Begin(void);
DictionaryIterator End(void); Iterator End(void);
long GetLength(void) const; long GetLength(void) const;

View File

@ -217,7 +217,7 @@ void CompatComponent::StatusTimerHandler(void)
Host host = it->second; Host host = it->second;
Dictionary::Ptr dict; Dictionary::Ptr dict;
DictionaryIterator dt; Dictionary::Iterator dt;
dict = host.GetGroups(); dict = host.GetGroups();
@ -258,7 +258,7 @@ void CompatComponent::StatusTimerHandler(void)
Service service = it->second; Service service = it->second;
Dictionary::Ptr dict; Dictionary::Ptr dict;
DictionaryIterator dt; Dictionary::Iterator dt;
dict = service.GetGroups(); dict = service.GetGroups();

View File

@ -112,7 +112,7 @@ json_t *MessagePart::GetJsonFromDictionary(const Dictionary::Ptr& dictionary)
json = cJSON_CreateObject(); 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()) { switch (i->second.GetType()) {
case VariantInteger: case VariantInteger:
cJSON_AddNumberToObject(json, i->first.c_str(), i->second.GetInteger()); cJSON_AddNumberToObject(json, i->first.c_str(), i->second.GetInteger());
@ -217,7 +217,7 @@ void MessagePart::AddUnnamedProperty(const MessagePart& value)
* *
* @returns An iterator. * @returns An iterator.
*/ */
DictionaryIterator MessagePart::Begin(void) Dictionary::Iterator MessagePart::Begin(void)
{ {
return GetDictionary()->Begin(); return GetDictionary()->Begin();
} }
@ -228,7 +228,7 @@ DictionaryIterator MessagePart::Begin(void)
* *
* @returns An iterator. * @returns An iterator.
*/ */
DictionaryIterator MessagePart::End(void) Dictionary::Iterator MessagePart::End(void)
{ {
return GetDictionary()->End(); return GetDictionary()->End();
} }

View File

@ -87,8 +87,8 @@ public:
bool Contains(const string& key) const; bool Contains(const string& key) const;
DictionaryIterator Begin(void); Dictionary::Iterator Begin(void);
DictionaryIterator End(void); Dictionary::Iterator End(void);
private: private:
Dictionary::Ptr m_Dictionary; Dictionary::Ptr m_Dictionary;