| 17 | } |
| 18 | |
| 19 | void 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. |
no test coverage detected