mirror of https://github.com/Icinga/icinga2.git
parent
7194b36d3e
commit
56ba6089d0
|
@ -56,6 +56,19 @@ void Array::Set(unsigned int index, const Value& value)
|
|||
m_Data.at(index) = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a value in the array.
|
||||
*
|
||||
* @param index The index.
|
||||
* @param value The value.
|
||||
*/
|
||||
void Array::Set(unsigned int index, Value&& value)
|
||||
{
|
||||
ObjectLock olock(this);
|
||||
|
||||
m_Data.at(index).Swap(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a value to the array.
|
||||
*
|
||||
|
@ -68,6 +81,18 @@ void Array::Add(const Value& value)
|
|||
m_Data.push_back(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a value to the array.
|
||||
*
|
||||
* @param value The value.
|
||||
*/
|
||||
void Array::Add(Value&& value)
|
||||
{
|
||||
ObjectLock olock(this);
|
||||
|
||||
m_Data.push_back(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of elements in the array.
|
||||
*
|
||||
|
|
|
@ -55,7 +55,9 @@ public:
|
|||
|
||||
Value Get(unsigned int index) const;
|
||||
void Set(unsigned int index, const Value& value);
|
||||
void Set(unsigned int index, Value&& value);
|
||||
void Add(const Value& value);
|
||||
void Add(Value&& value);
|
||||
|
||||
/**
|
||||
* Returns an iterator to the beginning of the array.
|
||||
|
|
|
@ -78,6 +78,18 @@ void Dictionary::Set(const String& key, const Value& value)
|
|||
m_Data[key] = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a value in the dictionary.
|
||||
*
|
||||
* @param key The key.
|
||||
* @param value The value.
|
||||
*/
|
||||
void Dictionary::Set(const String& key, Value&& value)
|
||||
{
|
||||
ObjectLock olock(this);
|
||||
|
||||
m_Data[key].Swap(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of elements in the dictionary.
|
||||
|
|
|
@ -58,6 +58,7 @@ public:
|
|||
Value Get(const String& key) const;
|
||||
bool Get(const String& key, Value *result) const;
|
||||
void Set(const String& key, const Value& value);
|
||||
void Set(const String& key, Value&& value);
|
||||
bool Contains(const String& key) const;
|
||||
|
||||
/**
|
||||
|
|
|
@ -244,11 +244,16 @@ public:
|
|||
*
|
||||
* @returns The type.
|
||||
*/
|
||||
ValueType GetType(void) const
|
||||
inline ValueType GetType(void) const
|
||||
{
|
||||
return static_cast<ValueType>(m_Value.which());
|
||||
}
|
||||
|
||||
inline void Swap(Value& other)
|
||||
{
|
||||
m_Value.swap(other.m_Value);
|
||||
}
|
||||
|
||||
String GetTypeName(void) const;
|
||||
|
||||
Type::Ptr GetReflectionType(void) const;
|
||||
|
|
Loading…
Reference in New Issue