| 170 | } |
| 171 | |
| 172 | void HostsTable::FetchRows(const AddRowFunction& addRowFn) |
| 173 | { |
| 174 | if (GetGroupByType() == LivestatusGroupByHostGroup) { |
| 175 | for (const HostGroup::Ptr& hg : ConfigType::GetObjectsByType<HostGroup>()) { |
| 176 | for (const Host::Ptr& host : hg->GetMembers()) { |
| 177 | /* the caller must know which groupby type and value are set for this row */ |
| 178 | if (!addRowFn(host, LivestatusGroupByHostGroup, hg)) |
| 179 | return; |
| 180 | } |
| 181 | } |
| 182 | } else { |
| 183 | for (const Host::Ptr& host : ConfigType::GetObjectsByType<Host>()) { |
| 184 | if (!addRowFn(host, LivestatusGroupByNone, Empty)) |
| 185 | return; |
| 186 | } |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | Object::Ptr HostsTable::HostGroupAccessor(LivestatusGroupByType groupByType, const Object::Ptr& groupByObject) |
| 191 | { |
nothing calls this directly
no test coverage detected