From 4bc1b8a46fad46958e475b5bd38c402cc3b8bcfb Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 23 Jun 2018 10:18:32 +0200 Subject: [PATCH 1/1] snake_case RoutedZone --- include/simgrid/kernel/routing/RoutedZone.hpp | 31 +++++++++++++++---- src/kernel/routing/DijkstraZone.cpp | 8 ++--- src/kernel/routing/FloydZone.cpp | 8 ++--- src/kernel/routing/FullZone.cpp | 6 ++-- src/kernel/routing/RoutedZone.cpp | 12 +++---- 5 files changed, 42 insertions(+), 23 deletions(-) diff --git a/include/simgrid/kernel/routing/RoutedZone.hpp b/include/simgrid/kernel/routing/RoutedZone.hpp index 443cd4e311..097e849207 100644 --- a/include/simgrid/kernel/routing/RoutedZone.hpp +++ b/include/simgrid/kernel/routing/RoutedZone.hpp @@ -54,14 +54,33 @@ public: void get_graph(xbt_graph_t graph, std::map* nodes, std::map* edges) override; - virtual RouteCreationArgs* newExtendedRoute(RoutingMode hierarchy, NetPoint* src, NetPoint* dst, NetPoint* gw_src, - NetPoint* gw_dst, std::vector& link_list, - bool symmetrical, bool change_order); protected: - void getRouteCheckParams(NetPoint* src, NetPoint* dst); - void addRouteCheckParams(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst, - std::vector& link_list, bool symmetrical); + virtual RouteCreationArgs* new_extended_route(RoutingMode hierarchy, NetPoint* src, NetPoint* dst, NetPoint* gw_src, + NetPoint* gw_dst, std::vector& link_list, + bool symmetrical, bool change_order); + void get_route_check_params(NetPoint* src, NetPoint* dst); + void add_route_check_params(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst, + std::vector& link_list, bool symmetrical); + + // deprecated + XBT_ATTRIB_DEPRECATED_v323("Please use RoutedZone::new_extended_route()") virtual RouteCreationArgs* newExtendedRoute( + RoutingMode hierarchy, NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst, + std::vector& link_list, bool symmetrical, bool change_order) + { + return new_extended_route(hierarchy, src, dst, gw_src, gw_dst, link_list, symmetrical, change_order); + } + XBT_ATTRIB_DEPRECATED_v323("Please use RoutedZone::get_route_check_params()") void getRouteCheckParams(NetPoint* src, + NetPoint* dst) + { + get_route_check_params(src, dst); + } + XBT_ATTRIB_DEPRECATED_v323("Please use RoutedZone::add_route_check_params()") void addRouteCheckParams( + NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst, std::vector& link_list, + bool symmetrical) + { + add_route_check_params(src, dst, gw_src, gw_dst, link_list, symmetrical); + } }; } // namespace routing } // namespace kernel diff --git a/src/kernel/routing/DijkstraZone.cpp b/src/kernel/routing/DijkstraZone.cpp index a377dc5317..b5642e3075 100644 --- a/src/kernel/routing/DijkstraZone.cpp +++ b/src/kernel/routing/DijkstraZone.cpp @@ -126,7 +126,7 @@ void DijkstraZone::new_route(int src_id, int dst_id, simgrid::kernel::routing::R void DijkstraZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat) { - getRouteCheckParams(src, dst); + get_route_check_params(src, dst); int src_id = src->id(); int dst_id = dst->id(); @@ -276,7 +276,7 @@ void DijkstraZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, Net const char* srcName = src->get_cname(); const char* dstName = dst->get_cname(); - addRouteCheckParams(src, dst, gw_src, gw_dst, link_list, symmetrical); + add_route_check_params(src, dst, gw_src, gw_dst, link_list, symmetrical); /* Create the topology graph */ if (not route_graph_) @@ -286,7 +286,7 @@ void DijkstraZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, Net * nodes */ /* Add the route to the base */ - RouteCreationArgs* e_route = newExtendedRoute(hierarchy_, src, dst, gw_src, gw_dst, link_list, symmetrical, 1); + RouteCreationArgs* e_route = new_extended_route(hierarchy_, src, dst, gw_src, gw_dst, link_list, symmetrical, 1); new_route(src->id(), dst->id(), e_route); // Symmetrical YES @@ -314,7 +314,7 @@ void DijkstraZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, Net gw_dst = gw_tmp; } RouteCreationArgs* link_route_back = - newExtendedRoute(hierarchy_, src, dst, gw_src, gw_dst, link_list, symmetrical, 0); + new_extended_route(hierarchy_, src, dst, gw_src, gw_dst, link_list, symmetrical, 0); new_route(dst->id(), src->id(), link_route_back); } } diff --git a/src/kernel/routing/FloydZone.cpp b/src/kernel/routing/FloydZone.cpp index dd92bc8fa1..5286d2e31e 100644 --- a/src/kernel/routing/FloydZone.cpp +++ b/src/kernel/routing/FloydZone.cpp @@ -48,7 +48,7 @@ void FloydZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* { unsigned int table_size = get_table_size(); - getRouteCheckParams(src, dst); + get_route_check_params(src, dst); /* create a result route */ std::vector route_stack; @@ -91,7 +91,7 @@ void FloydZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoi /* set the size of table routing */ unsigned int table_size = get_table_size(); - addRouteCheckParams(src, dst, gw_src, gw_dst, link_list, symmetrical); + add_route_check_params(src, dst, gw_src, gw_dst, link_list, symmetrical); if (not link_table_) { /* Create Cost, Predecessor and Link tables */ @@ -119,7 +119,7 @@ void FloydZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoi dst->get_cname()); TO_FLOYD_LINK(src->id(), dst->id()) = - newExtendedRoute(hierarchy_, src, dst, gw_src, gw_dst, link_list, symmetrical, 1); + new_extended_route(hierarchy_, src, dst, gw_src, gw_dst, link_list, symmetrical, 1); TO_FLOYD_PRED(src->id(), dst->id()) = src->id(); TO_FLOYD_COST(src->id(), dst->id()) = (TO_FLOYD_LINK(src->id(), dst->id()))->link_list.size(); @@ -147,7 +147,7 @@ void FloydZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoi src->get_cname(), gw_dst->get_cname()); TO_FLOYD_LINK(dst->id(), src->id()) = - newExtendedRoute(hierarchy_, src, dst, gw_src, gw_dst, link_list, symmetrical, 0); + new_extended_route(hierarchy_, src, dst, gw_src, gw_dst, link_list, symmetrical, 0); TO_FLOYD_PRED(dst->id(), src->id()) = dst->id(); TO_FLOYD_COST(dst->id(), src->id()) = (TO_FLOYD_LINK(dst->id(), src->id()))->link_list.size(); /* count of links, old model assume 1 */ diff --git a/src/kernel/routing/FullZone.cpp b/src/kernel/routing/FullZone.cpp index 16d3969952..77904a4a2b 100644 --- a/src/kernel/routing/FullZone.cpp +++ b/src/kernel/routing/FullZone.cpp @@ -74,7 +74,7 @@ void FullZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* void FullZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst, std::vector& link_list, bool symmetrical) { - addRouteCheckParams(src, dst, gw_src, gw_dst, link_list, symmetrical); + add_route_check_params(src, dst, gw_src, gw_dst, link_list, symmetrical); unsigned int table_size = get_table_size(); @@ -93,7 +93,7 @@ void FullZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoin /* Add the route to the base */ TO_ROUTE_FULL(src->id(), dst->id()) = - newExtendedRoute(hierarchy_, src, dst, gw_src, gw_dst, link_list, symmetrical, true); + new_extended_route(hierarchy_, src, dst, gw_src, gw_dst, link_list, symmetrical, true); if (symmetrical == true && src != dst) { if (gw_dst && gw_src) { @@ -112,7 +112,7 @@ void FullZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoin dst->get_cname(), src->get_cname()); TO_ROUTE_FULL(dst->id(), src->id()) = - newExtendedRoute(hierarchy_, src, dst, gw_src, gw_dst, link_list, symmetrical, false); + new_extended_route(hierarchy_, src, dst, gw_src, gw_dst, link_list, symmetrical, false); } } } diff --git a/src/kernel/routing/RoutedZone.cpp b/src/kernel/routing/RoutedZone.cpp index 2de68c1f99..dc502fd548 100644 --- a/src/kernel/routing/RoutedZone.cpp +++ b/src/kernel/routing/RoutedZone.cpp @@ -120,9 +120,9 @@ void RoutedZone::get_graph(xbt_graph_t graph, std::map* /* ************************************************************************** */ /* ************************* GENERIC AUX FUNCTIONS ************************** */ /* change a route containing link names into a route containing link entities */ -RouteCreationArgs* RoutedZone::newExtendedRoute(RoutingMode hierarchy, NetPoint* src, NetPoint* dst, NetPoint* gw_src, - NetPoint* gw_dst, std::vector& link_list, - bool symmetrical, bool change_order) +RouteCreationArgs* RoutedZone::new_extended_route(RoutingMode hierarchy, NetPoint* src, NetPoint* dst, NetPoint* gw_src, + NetPoint* gw_dst, std::vector& link_list, + bool symmetrical, bool change_order) { RouteCreationArgs* result = new RouteCreationArgs(); @@ -147,7 +147,7 @@ RouteCreationArgs* RoutedZone::newExtendedRoute(RoutingMode hierarchy, NetPoint* return result; } -void RoutedZone::getRouteCheckParams(NetPoint* src, NetPoint* dst) +void RoutedZone::get_route_check_params(NetPoint* src, NetPoint* dst) { xbt_assert(src, "Cannot find a route from nullptr to %s", dst->get_cname()); xbt_assert(dst, "Cannot find a route from %s to nullptr", src->get_cname()); @@ -164,8 +164,8 @@ void RoutedZone::getRouteCheckParams(NetPoint* src, NetPoint* dst) "%s@%s). Please report that bug.", src->get_cname(), dst->get_cname(), src_as->get_cname(), dst_as->get_cname(), get_cname()); } -void RoutedZone::addRouteCheckParams(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst, - std::vector& link_list, bool symmetrical) +void RoutedZone::add_route_check_params(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst, + std::vector& link_list, bool symmetrical) { const char* srcName = src->get_cname(); const char* dstName = dst->get_cname(); -- 2.20.1