mirror of
https://github.com/Icinga/icinga2.git
synced 2025-09-23 17:57:54 +02:00
ConfigObject#OnAllConfigLoaded(): build m_AllParentsAffectingLogging cache
recursively from ConfigObject#GetParentsAffectingLogging().
This commit is contained in:
parent
f98b5c5d7c
commit
a3a6a8ab21
@ -419,6 +419,18 @@ void ConfigObject::OnAllConfigLoaded()
|
|||||||
|
|
||||||
if (!zoneName.IsEmpty())
|
if (!zoneName.IsEmpty())
|
||||||
m_Zone = ctype->GetObject(zoneName);
|
m_Zone = ctype->GetObject(zoneName);
|
||||||
|
|
||||||
|
std::vector<Ptr> toDo {this};
|
||||||
|
|
||||||
|
do {
|
||||||
|
auto current (toDo.back());
|
||||||
|
|
||||||
|
toDo.pop_back();
|
||||||
|
|
||||||
|
if (m_AllParentsAffectingLogging.emplace(current.get()).second) {
|
||||||
|
current->GetParentsAffectingLogging(toDo);
|
||||||
|
}
|
||||||
|
} while (!toDo.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigObject::CreateChildObjects(const Type::Ptr& childType)
|
void ConfigObject::CreateChildObjects(const Type::Ptr& childType)
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include "base/type.hpp"
|
#include "base/type.hpp"
|
||||||
#include "base/dictionary.hpp"
|
#include "base/dictionary.hpp"
|
||||||
#include <boost/signals2.hpp>
|
#include <boost/signals2.hpp>
|
||||||
|
#include <set>
|
||||||
|
|
||||||
namespace icinga
|
namespace icinga
|
||||||
{
|
{
|
||||||
@ -81,6 +82,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
ConfigObject::Ptr m_Zone;
|
ConfigObject::Ptr m_Zone;
|
||||||
|
std::set<ConfigObject*> m_AllParentsAffectingLogging;
|
||||||
|
|
||||||
static void RestoreObject(const String& message, int attributeTypes);
|
static void RestoreObject(const String& message, int attributeTypes);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user