mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-20 20:24:33 +02:00
Checkable: Introduce HasAnyDependencies()
method
This commit is contained in:
parent
ff0dabe287
commit
27f11a0955
@ -44,6 +44,12 @@ std::vector<Dependency::Ptr> Checkable::GetDependencies() const
|
||||
return dependencies;
|
||||
}
|
||||
|
||||
bool Checkable::HasAnyDependencies() const
|
||||
{
|
||||
std::unique_lock lock(m_DependencyMutex);
|
||||
return !m_DependencyGroups.empty() || !m_ReverseDependencies.empty();
|
||||
}
|
||||
|
||||
void Checkable::AddReverseDependency(const Dependency::Ptr& dep)
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(m_DependencyMutex);
|
||||
|
@ -189,6 +189,7 @@ public:
|
||||
void RemoveDependencyGroup(const intrusive_ptr<DependencyGroup>& dependencyGroup);
|
||||
std::vector<intrusive_ptr<DependencyGroup>> GetDependencyGroups() const;
|
||||
std::vector<intrusive_ptr<Dependency> > GetDependencies() const;
|
||||
bool HasAnyDependencies() const;
|
||||
|
||||
void AddReverseDependency(const intrusive_ptr<Dependency>& dep);
|
||||
void RemoveReverseDependency(const intrusive_ptr<Dependency>& dep);
|
||||
|
Loading…
x
Reference in New Issue
Block a user