From 621459781d2f162d66aa46fb9c3ab08bb076c442 Mon Sep 17 00:00:00 2001 From: Bruno Donassolo Date: Wed, 14 Apr 2021 17:53:28 +0200 Subject: [PATCH] Simplify add_route methods. Leave only one add_route method, as it was initially. Deprecate old add_route which uses LinkImpl*, s4u is the interface we want with user. --- include/simgrid/s4u/NetZone.hpp | 28 ++++++++-------------------- src/s4u/s4u_Netzone.cpp | 14 ++++---------- 2 files changed, 12 insertions(+), 30 deletions(-) diff --git a/include/simgrid/s4u/NetZone.hpp b/include/simgrid/s4u/NetZone.hpp index 55ba9faf79..08e9c2a042 100644 --- a/include/simgrid/s4u/NetZone.hpp +++ b/include/simgrid/s4u/NetZone.hpp @@ -68,20 +68,9 @@ public: /** * @brief Add a route between 2 netpoints * - * Create a regular route between 2 netpoints. A netpoint can be a host - * or a router. - * - * @param src Source netpoint - * @param dst Destination netpoint - * @param link_list List of links used in this communication - * @param symmetrical Bi-directional communication - */ - void add_regular_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, - const std::vector& link_list, bool symmetrical = true); - /** - * @brief Add a route between 2 netzones - * - * Create a route between 2 netzones, connecting 2 gateways. + * Create a route: + * - route between 2 hosts/routers in same netzone, no gateway is needed + * - route between 2 netzones, connecting 2 gateways. * * @param src Source netzone's netpoint * @param dst Destination netzone' netpoint @@ -90,13 +79,12 @@ public: * @param link_list List of links used in this communication * @param symmetrical Bi-directional communication */ - void add_netzone_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, - kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst, - const std::vector& link_list, bool symmetrical = true); - void add_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, kernel::routing::NetPoint* gw_src, - kernel::routing::NetPoint* gw_dst, const std::vector& link_list, - bool symmetrical); + kernel::routing::NetPoint* gw_dst, const std::vector& link_list, bool symmetrical = true); + + XBT_ATTRIB_DEPRECATED_v332("Please use add_route() method which uses s4u::Link instead of LinkImpl") void add_route( + kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, kernel::routing::NetPoint* gw_src, + kernel::routing::NetPoint* gw_dst, const std::vector& link_list, bool symmetrical); void add_bypass_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst, std::vector& link_list, bool symmetrical); diff --git a/src/s4u/s4u_Netzone.cpp b/src/s4u/s4u_Netzone.cpp index cfa9da0475..377577dd7b 100644 --- a/src/s4u/s4u_Netzone.cpp +++ b/src/s4u/s4u_Netzone.cpp @@ -108,17 +108,11 @@ std::vector NetZone::get_link_list_impl(const std:: return links; } -void NetZone::add_regular_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, - const std::vector& link_list, bool symmetrical) -{ - add_route(src, dst, nullptr, nullptr, NetZone::get_link_list_impl(link_list), symmetrical); -} - -void NetZone::add_netzone_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, - kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst, - const std::vector& link_list, bool symmetrical) +void NetZone::add_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, + kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst, + const std::vector& link_list, bool symmetrical) { - add_route(src, dst, gw_src, gw_dst, NetZone::get_link_list_impl(link_list), symmetrical); + pimpl_->add_route(src, dst, gw_src, gw_dst, NetZone::get_link_list_impl(link_list), symmetrical); } void NetZone::add_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, -- 2.20.1