mirror of https://github.com/Icinga/icinga2.git
Allow some of the Array and Dictionary methods to be inlined by the compiler
fixes #8666
This commit is contained in:
parent
54b5cd33e5
commit
37aa3413d8
|
@ -69,34 +69,6 @@ void Array::Add(const Value& value)
|
|||
m_Data.push_back(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an iterator to the beginning of the array.
|
||||
*
|
||||
* Note: Caller must hold the object lock while using the iterator.
|
||||
*
|
||||
* @returns An iterator.
|
||||
*/
|
||||
Array::Iterator Array::Begin(void)
|
||||
{
|
||||
ASSERT(OwnsLock());
|
||||
|
||||
return m_Data.begin();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an iterator to the end of the array.
|
||||
*
|
||||
* Note: Caller must hold the object lock while using the iterator.
|
||||
*
|
||||
* @returns An iterator.
|
||||
*/
|
||||
Array::Iterator Array::End(void)
|
||||
{
|
||||
ASSERT(OwnsLock());
|
||||
|
||||
return m_Data.end();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of elements in the array.
|
||||
*
|
||||
|
|
|
@ -49,8 +49,33 @@ public:
|
|||
void Set(unsigned int index, const Value& value);
|
||||
void Add(const Value& value);
|
||||
|
||||
Iterator Begin(void);
|
||||
Iterator End(void);
|
||||
/**
|
||||
* Returns an iterator to the beginning of the array.
|
||||
*
|
||||
* Note: Caller must hold the object lock while using the iterator.
|
||||
*
|
||||
* @returns An iterator.
|
||||
*/
|
||||
inline Iterator Begin(void)
|
||||
{
|
||||
ASSERT(OwnsLock());
|
||||
|
||||
return m_Data.begin();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an iterator to the end of the array.
|
||||
*
|
||||
* Note: Caller must hold the object lock while using the iterator.
|
||||
*
|
||||
* @returns An iterator.
|
||||
*/
|
||||
inline Iterator End(void)
|
||||
{
|
||||
ASSERT(OwnsLock());
|
||||
|
||||
return m_Data.end();
|
||||
}
|
||||
|
||||
size_t GetLength(void) const;
|
||||
bool Contains(const Value& value) const;
|
||||
|
|
|
@ -108,33 +108,6 @@ void Dictionary::Set(const String& key, const Value& value)
|
|||
ret.first->second = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an iterator to the beginning of the dictionary.
|
||||
*
|
||||
* Note: Caller must hold the object lock while using the iterator.
|
||||
*
|
||||
* @returns An iterator.
|
||||
*/
|
||||
Dictionary::Iterator Dictionary::Begin(void)
|
||||
{
|
||||
ASSERT(OwnsLock());
|
||||
|
||||
return m_Data.begin();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an iterator to the end of the dictionary.
|
||||
*
|
||||
* Note: Caller must hold the object lock while using the iterator.
|
||||
*
|
||||
* @returns An iterator.
|
||||
*/
|
||||
Dictionary::Iterator Dictionary::End(void)
|
||||
{
|
||||
ASSERT(OwnsLock());
|
||||
|
||||
return m_Data.end();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of elements in the dictionary.
|
||||
|
@ -182,18 +155,6 @@ void Dictionary::Remove(const String& key)
|
|||
m_Data.erase(it);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the item specified by the iterator from the dictionary.
|
||||
*
|
||||
* @param it The iterator.
|
||||
*/
|
||||
void Dictionary::Remove(Dictionary::Iterator it)
|
||||
{
|
||||
ASSERT(OwnsLock());
|
||||
|
||||
m_Data.erase(it);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all dictionary items.
|
||||
*/
|
||||
|
|
|
@ -54,13 +54,49 @@ public:
|
|||
void Set(const String& key, const Value& value);
|
||||
bool Contains(const String& key) const;
|
||||
|
||||
Iterator Begin(void);
|
||||
Iterator End(void);
|
||||
/**
|
||||
* Returns an iterator to the beginning of the dictionary.
|
||||
*
|
||||
* Note: Caller must hold the object lock while using the iterator.
|
||||
*
|
||||
* @returns An iterator.
|
||||
*/
|
||||
inline Iterator Begin(void)
|
||||
{
|
||||
ASSERT(OwnsLock());
|
||||
|
||||
return m_Data.begin();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an iterator to the end of the dictionary.
|
||||
*
|
||||
* Note: Caller must hold the object lock while using the iterator.
|
||||
*
|
||||
* @returns An iterator.
|
||||
*/
|
||||
inline Iterator End(void)
|
||||
{
|
||||
ASSERT(OwnsLock());
|
||||
|
||||
return m_Data.end();
|
||||
}
|
||||
|
||||
size_t GetLength(void) const;
|
||||
|
||||
void Remove(const String& key);
|
||||
void Remove(Iterator it);
|
||||
|
||||
/**
|
||||
* Removes the item specified by the iterator from the dictionary.
|
||||
*
|
||||
* @param it The iterator.
|
||||
*/
|
||||
inline void Remove(Iterator it)
|
||||
{
|
||||
ASSERT(OwnsLock());
|
||||
|
||||
m_Data.erase(it);
|
||||
}
|
||||
|
||||
void Clear(void);
|
||||
|
||||
|
|
Loading…
Reference in New Issue