mirror of
https://github.com/Icinga/icinga2.git
synced 2025-09-23 09:48:05 +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())
|
||||
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)
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "base/type.hpp"
|
||||
#include "base/dictionary.hpp"
|
||||
#include <boost/signals2.hpp>
|
||||
#include <set>
|
||||
|
||||
namespace icinga
|
||||
{
|
||||
@ -81,6 +82,7 @@ public:
|
||||
|
||||
private:
|
||||
ConfigObject::Ptr m_Zone;
|
||||
std::set<ConfigObject*> m_AllParentsAffectingLogging;
|
||||
|
||||
static void RestoreObject(const String& message, int attributeTypes);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user