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

Method CopyDependenciesTo

lib/icinga/dependency-group.cpp:224–234  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

222 * @param dest The dependency group to copy the dependencies to.
223 */
224void 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.

Callers 1

RegisterMethod · 0.80

Calls 3

beginMethod · 0.45
endMethod · 0.45
AddDependencyMethod · 0.45

Tested by

no test coverage detected