1.8. Get entities of a given kind

The StatisticsBackend singleton can be queried about all the entities of a given EntityKind. For example, get_entities() function can be used to retrieve all the HOST for which statistics are reported.

// Get all hosts
std::vector<EntityId> hosts = StatisticsBackend::get_entities(EntityKind::HOST);
for (EntityId host : hosts)
{
    std::cout << "Host ID: " << host << std::endl;
}

This call to get_entities() is the same as:

StatisticsBackend::get_entities(EntityKind::HOST, EntityId::all());