* Copy the dependency objects of the current dependency group to the provided dependency group (destination). * * @param dest The dependency group to copy the dependencies to. */
| 222 | * @param dest The dependency group to copy the dependencies to. |
| 223 | */ |
| 224 | void DependencyGroup::CopyDependenciesTo(const DependencyGroup::Ptr& dest) |
| 225 | { |
| 226 | VERIFY(this != dest); // Prevent from doing something stupid, i.e. deadlocking ourselves. |
| 227 | |
| 228 | std::lock_guard lock(m_Mutex); |
| 229 | for (auto& [_, children] : m_Members) { |
| 230 | std::for_each(children.begin(), children.end(), [&dest](const auto& pair) { |
| 231 | dest->AddDependency(pair.second); |
| 232 | }); |
| 233 | } |
| 234 | } |
| 235 | |
| 236 | /** |
| 237 | * Set the Icinga DB identifier for the current dependency group. |
no test coverage detected