* Returns all the parent objects of the given child object. * * @param child The child object. * * @returns A list of the parent objects. */
| 40 | * @returns A list of the parent objects. |
| 41 | */ |
| 42 | std::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. |
no test coverage detected