mirror of
https://github.com/Icinga/icinga2.git
synced 2025-06-22 14:40:17 +02:00
Renamed DictionaryIterator to Dictionary::Iterator.
This commit is contained in:
parent
b576bb5ecc
commit
338e2bcbb1
@ -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();
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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();
|
||||||
|
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user