+# THIS IS ONLY FOR THE FILES. To add your test (tesh) as well, make sure you add
+# the same at the bottom of the file as well.
foreach (example actor-create actor-daemon actor-join actor-kill
actor-lifetime actor-migration actor-suspend actor-yield
app-chainsend app-masterworker app-pingpong app-token-ring
async-wait async-waitany async-waitall
cloud-capping cloud-migration cloud-simple
energy-exec energy-boot energy-link energy-vm
+ engine-filtering
exec-async exec-basic exec-dvfs exec-monitor exec-ptask exec-remote
io-file-system io-file-remote io-storage-raw
mutex
cloud-capping cloud-migration cloud-simple
dht-chord dht-kademlia
energy-exec energy-boot energy-link energy-vm
+ engine-filtering
exec-async exec-basic exec-dvfs exec-monitor exec-ptask exec-remote
platform-properties plugin-hostload mutex
io-file-system io-file-remote io-storage-raw
public:
size_t get_host_count();
std::vector<Host*> get_all_hosts();
+ std::vector<Host*> get_filtered_hosts(std::function<bool(Host*)> filter);
simgrid::s4u::Host* host_by_name(std::string name);
simgrid::s4u::Host* host_by_name_or_null(std::string name);
return res;
}
+std::vector<Host*> Engine::get_filtered_hosts(std::function<bool(Host*)> filter)
+{
+ std::vector<Host*> hosts;
+ for (auto const& kv : pimpl->hosts_) {
+ if (filter(kv.second))
+ hosts.push_back(kv.second);
+ }
+
+ return hosts;
+}
+
void Engine::host_register(std::string name, simgrid::s4u::Host* host)
{
pimpl->hosts_[name] = host;