MCPcopy Create free account
hub / github.com/Icinga/icinga2 / RemoveDependency

Method RemoveDependency

lib/base/dependencygraph.cpp:19–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17}
18
19void DependencyGraph::RemoveDependency(ConfigObject* child, ConfigObject* parent)
20{
21 std::unique_lock<std::mutex> lock(m_Mutex);
22
23 if (auto it(m_Dependencies.find(Edge(parent, child))); it != m_Dependencies.end()) {
24 if (it->count > 1) {
25 // Remove a duplicate edge from child to node, i.e. decrement the corresponding counter.
26 m_Dependencies.modify(it, [](Edge& e) { e.count--; });
27 } else {
28 // Remove the last edge from child to node (decrementing the counter would set it to 0),
29 // thus remove that connection from the data structure completely.
30 m_Dependencies.erase(it);
31 }
32 }
33}
34
35/**
36 * Returns all the parent objects of the given child object.

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.45

Calls 4

EdgeClass · 0.85
findMethod · 0.80
endMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected