1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
6 #include "icinga/i2-icinga.hpp"
7 #include "icinga/dependency-ti.hpp"
18 * A service dependency..
22 class Dependency final : public ObjectImpl<Dependency>
25 DECLARE_OBJECT(Dependency);
26 DECLARE_OBJECTNAME(Dependency);
28 intrusive_ptr<Checkable> GetParent() const;
29 intrusive_ptr<Checkable> GetChild() const;
31 TimePeriod::Ptr GetPeriod() const;
33 bool IsAvailable(DependencyType dt) const;
35 void ValidateStates(const Lazy<Array::Ptr>& lvalue, const ValidationUtils& utils) override;
37 static void EvaluateApplyRules(const intrusive_ptr<Host>& host);
38 static void EvaluateApplyRules(const intrusive_ptr<Service>& service);
41 void OnConfigLoaded() override;
42 void OnAllConfigLoaded() override;
43 void Stop(bool runtimeRemoved) override;
46 Checkable::Ptr m_Parent;
47 Checkable::Ptr m_Child;
49 static bool EvaluateApplyRuleInstance(const Checkable::Ptr& checkable, const String& name, ScriptFrame& frame, const ApplyRule& rule);
50 static bool EvaluateApplyRule(const Checkable::Ptr& checkable, const ApplyRule& rule);
55 #endif /* DEPENDENCY_H */