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

Method AddGroup

lib/icinga/checkable.cpp:152–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152void Checkable::AddGroup(const String& name)
153{
154 std::unique_lock<std::mutex> lock(m_CheckableMutex);
155
156 Array::Ptr groups;
157 auto *host = dynamic_cast<Host *>(this);
158
159 if (host)
160 groups = host->GetGroups();
161 else
162 groups = static_cast<Service *>(this)->GetGroups();
163
164 if (groups && groups->Contains(name))
165 return;
166
167 if (!groups)
168 groups = new Array();
169
170 groups->Add(name);
171}
172
173AcknowledgementType Checkable::GetAcknowledgement()
174{

Callers

nothing calls this directly

Calls 2

ContainsMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected