/* Since hosts_ and links_ are a std::map, the hosts are destroyed in the lexicographic order, which ensures that the
* output is reproducible.
*/
/* Since hosts_ and links_ are a std::map, the hosts are destroyed in the lexicographic order, which ensures that the
* output is reproducible.
*/
std::vector<s4u::Link*> NetZoneImpl::get_filtered_links(const std::function<bool(s4u::Link*)>& filter) const
{
std::vector<s4u::Link*> filtered_list;
std::vector<s4u::Link*> NetZoneImpl::get_filtered_links(const std::function<bool(s4u::Link*)>& filter) const
{
std::vector<s4u::Link*> filtered_list;
- for (auto const& kv : links_) {
- s4u::Link* l = kv.second->get_iface();
+ for (auto const& [_, link] : links_) {
+ s4u::Link* l = link->get_iface();
if (host->get_name() == name)
return host;
/* keep old behavior where host and VMs were saved together on EngineImpl::hosts_
if (host->get_name() == name)
return host;
/* keep old behavior where host and VMs were saved together on EngineImpl::hosts_
std::vector<s4u::Host*> NetZoneImpl::get_filtered_hosts(const std::function<bool(s4u::Host*)>& filter) const
{
std::vector<s4u::Host*> filtered_list;
std::vector<s4u::Host*> NetZoneImpl::get_filtered_hosts(const std::function<bool(s4u::Host*)>& filter) const
{
std::vector<s4u::Host*> filtered_list;
- for (auto const& kv : hosts_) {
- s4u::Host* h = kv.second->get_iface();
+ for (auto const& [_, host] : hosts_) {
+ s4u::Host* h = host->get_iface();
- for (auto const& kv : links_)
- kv.second->get_iface()->seal();
+ for (auto const& [_, link] : links_)
+ link->get_iface()->seal();