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.
*/
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();
}

View 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;

View 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();

View 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();
}

View 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;