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

Method GetParents

lib/base/dependencygraph.cpp:42–53  ·  view source on GitHub ↗

* Returns all the parent objects of the given child object. * * @param child The child object. * * @returns A list of the parent objects. */

Source from the content-addressed store, hash-verified

40 * @returns A list of the parent objects.
41 */
42std::vector<ConfigObject::Ptr> DependencyGraph::GetParents(const ConfigObject::Ptr& child)
43{
44 std::vector<ConfigObject::Ptr> objects;
45
46 std::unique_lock lock(m_Mutex);
47 auto [begin, end] = m_Dependencies.get<2>().equal_range(child.get());
48 std::transform(begin, end, std::back_inserter(objects), [](const Edge& edge) {
49 return edge.parent;
50 });
51
52 return objects;
53}
54
55/**
56 * Returns all the dependent objects of the given parent object.

Callers 3

OnConfigUpdateHeavyMethod · 0.45
CalculateConfigHashMethod · 0.45
ParentsAccessorMethod · 0.45

Calls 1

getMethod · 0.45

Tested by

no test coverage detected