| 154 | } |
| 155 | |
| 156 | void ServicesTable::FetchRows(const AddRowFunction& addRowFn) |
| 157 | { |
| 158 | if (GetGroupByType() == LivestatusGroupByServiceGroup) { |
| 159 | for (const ServiceGroup::Ptr& sg : ConfigType::GetObjectsByType<ServiceGroup>()) { |
| 160 | for (const Service::Ptr& service : sg->GetMembers()) { |
| 161 | /* the caller must know which groupby type and value are set for this row */ |
| 162 | if (!addRowFn(service, LivestatusGroupByServiceGroup, sg)) |
| 163 | return; |
| 164 | } |
| 165 | } |
| 166 | } else if (GetGroupByType() == LivestatusGroupByHostGroup) { |
| 167 | for (const HostGroup::Ptr& hg : ConfigType::GetObjectsByType<HostGroup>()) { |
| 168 | ObjectLock ylock(hg); |
| 169 | for (const Host::Ptr& host : hg->GetMembers()) { |
| 170 | ObjectLock ylock(host); |
| 171 | for (const Service::Ptr& service : host->GetServices()) { |
| 172 | /* the caller must know which groupby type and value are set for this row */ |
| 173 | if (!addRowFn(service, LivestatusGroupByHostGroup, hg)) |
| 174 | return; |
| 175 | } |
| 176 | } |
| 177 | } |
| 178 | } else { |
| 179 | for (const Service::Ptr& service : ConfigType::GetObjectsByType<Service>()) { |
| 180 | if (!addRowFn(service, LivestatusGroupByNone, Empty)) |
| 181 | return; |
| 182 | } |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | Object::Ptr ServicesTable::HostAccessor(const Value& row, const Column::ObjectAccessor& parentObjectAccessor) |
| 187 | { |
nothing calls this directly
no test coverage detected