| 150 | } |
| 151 | |
| 152 | void 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 | |
| 173 | AcknowledgementType Checkable::GetAcknowledgement() |
| 174 | { |