From 2b5a32d440ace6920ebbe5b5425aedd515d11708 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 13 Feb 2016 15:29:51 +0100 Subject: [PATCH] routing: move an empty implementation to the super class --- src/surf/surf_routing.cpp | 5 +++++ src/surf/surf_routing.hpp | 2 +- src/surf/surf_routing_none.cpp | 4 ---- src/surf/surf_routing_none.hpp | 1 - 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/surf/surf_routing.cpp b/src/surf/surf_routing.cpp index b484350dd7..fbc8c5ce9d 100644 --- a/src/surf/surf_routing.cpp +++ b/src/surf/surf_routing.cpp @@ -43,6 +43,11 @@ namespace surf { delete netcard_; } + sg_platf_route_cbarg_t As::getBypassRoute(NetCard * /*src*/, NetCard * /*dst*/, double * /*lat*/) { + return NULL; + } + + int As::addComponent(NetCard *elm) { XBT_DEBUG("Load component \"%s\"", elm->getName()); xbt_dynar_push_as(vertices_, NetCard*, elm); diff --git a/src/surf/surf_routing.hpp b/src/surf/surf_routing.hpp index a97b766440..a34a85ef00 100644 --- a/src/surf/surf_routing.hpp +++ b/src/surf/surf_routing.hpp @@ -96,7 +96,7 @@ public: virtual void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)=0; - virtual sg_platf_route_cbarg_t getBypassRoute(NetCard *src, NetCard *dst,double *lat)=0; + virtual sg_platf_route_cbarg_t getBypassRoute(NetCard *src, NetCard *dst,double *lat); /* Add content to the AS, at parsing time. It should be sealed afterward. */ virtual int addComponent(NetCard *elm); /* A host, a router or an AS, whatever */ diff --git a/src/surf/surf_routing_none.cpp b/src/surf/surf_routing_none.cpp index 88207226db..cfb4587272 100644 --- a/src/surf/surf_routing_none.cpp +++ b/src/surf/surf_routing_none.cpp @@ -31,9 +31,5 @@ void AsNone::getGraph(xbt_graph_t /*graph*/, xbt_dict_t /*nodes*/, xbt_dict_t /* { XBT_INFO("No routing no graph"); } - -sg_platf_route_cbarg_t AsNone::getBypassRoute(NetCard * /*src*/, NetCard * /*dst*/, double * /*lat*/) { - return NULL; -} } } diff --git a/src/surf/surf_routing_none.hpp b/src/surf/surf_routing_none.hpp index c1d45b13c8..3c471b1eea 100644 --- a/src/surf/surf_routing_none.hpp +++ b/src/surf/surf_routing_none.hpp @@ -24,7 +24,6 @@ public: void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency) override; xbt_dynar_t getOneLinkRoutes() override; void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) override; - sg_platf_route_cbarg_t getBypassRoute(NetCard *src, NetCard *dst, double *lat) override; }; } -- 2.20.1