From: Bruno Donassolo Date: Tue, 6 Apr 2021 09:30:04 +0000 (+0200) Subject: Single way to create links in NetZone X-Git-Tag: v3.28~455^2~150 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/e8fc101ac38c951ced584160c9d411477f4c5818 Single way to create links in NetZone With the refactoring, we don't need 2 methods in NetZoneImpl to create new links. The link type (wifi or wired) is determined by the NetZone type (WifiZone). --- diff --git a/include/simgrid/kernel/routing/NetZoneImpl.hpp b/include/simgrid/kernel/routing/NetZoneImpl.hpp index ae410c5e51..6246bf4216 100644 --- a/include/simgrid/kernel/routing/NetZoneImpl.hpp +++ b/include/simgrid/kernel/routing/NetZoneImpl.hpp @@ -134,7 +134,6 @@ public: s4u::Disk* create_disk(const std::string& name, double read_bandwidth, double write_bandwidth); /** @brief Make a link within that NetZone */ virtual s4u::Link* create_link(const std::string& name, const std::vector& bandwidths); - virtual s4u::Link* create_wifi_link(const std::string& name, const std::vector& bandwidths); /** @brief Creates a new route in this NetZone */ virtual void add_bypass_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst, std::vector& link_list, bool symmetrical); diff --git a/src/kernel/routing/NetZoneImpl.cpp b/src/kernel/routing/NetZoneImpl.cpp index 1db3805493..4df1cefb6a 100644 --- a/src/kernel/routing/NetZoneImpl.cpp +++ b/src/kernel/routing/NetZoneImpl.cpp @@ -152,11 +152,6 @@ s4u::Link* NetZoneImpl::create_link(const std::string& name, const std::vectorcreate_link(name, bandwidths)->get_iface(); } -s4u::Link* NetZoneImpl::create_wifi_link(const std::string& name, const std::vector& bandwidths) -{ - return network_model_->create_wifi_link(name, bandwidths)->get_iface(); -} - s4u::Host* NetZoneImpl::create_host(const std::string& name, const std::vector& speed_per_pstate) { auto* res = (new surf::HostImpl(name))->get_iface(); diff --git a/src/kernel/routing/WifiZone.cpp b/src/kernel/routing/WifiZone.cpp index 91ea7612e0..f6693e0bd1 100644 --- a/src/kernel/routing/WifiZone.cpp +++ b/src/kernel/routing/WifiZone.cpp @@ -57,9 +57,9 @@ s4u::Link* WifiZone::create_link(const std::string& name, const std::vectorset_sharing_policy(s4u::Link::SharingPolicy::WIFI); - wifi_link_ = s4u_link->get_impl(); - return s4u_link; + wifi_link_ = get_network_model()->create_wifi_link(name, bandwidths); + wifi_link_->set_sharing_policy(s4u::Link::SharingPolicy::WIFI); + return wifi_link_->get_iface(); } } // namespace routing } // namespace kernel