X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8bcc1dbe28f658ea786ba234a679601edd30758a..e37abccaa5b5cfb44e2cfcf68d5156766da28dc1:/src/surf/surf_routing_dijkstra.hpp diff --git a/src/surf/surf_routing_dijkstra.hpp b/src/surf/surf_routing_dijkstra.hpp index aa8400070d..0bf2e1f8d1 100644 --- a/src/surf/surf_routing_dijkstra.hpp +++ b/src/surf/surf_routing_dijkstra.hpp @@ -6,7 +6,7 @@ #include -#include "surf_routing_generic.hpp" +#include "surf_routing_RoutedGraph.hpp" #ifndef SURF_ROUTING_DIJKSTRA_HPP_ #define SURF_ROUTING_DIJKSTRA_HPP_ @@ -25,19 +25,25 @@ typedef struct route_cache_element { int size; } s_route_cache_element_t, *route_cache_element_t; +namespace simgrid { +namespace surf { + /*********** * Classes * ***********/ + class XBT_PRIVATE AsDijkstra; -class AsDijkstra : public AsGeneric { +/** Dijkstra routing data: fast initialization, slow lookup, small memory requirements, shortest path routing only */ +class AsDijkstra : public AsRoutedGraph { public: - AsDijkstra(); - AsDijkstra(int cached); + AsDijkstra(const char*name, bool cached); + void Seal() override; + ~AsDijkstra(); - xbt_node_t routeGraphNewNode(int id, int graph_id); - graph_node_map_element_t nodeMapSearch(int id); - void newRoute(int src_id, int dst_id, sg_platf_route_cbarg_t e_route); + xbt_node_t routeGraphNewNode(int id, int graph_id); + graph_node_map_element_t nodeMapSearch(int id); + void newRoute(int src_id, int dst_id, sg_platf_route_cbarg_t e_route); /** * For each vertex (node) already in the graph, * make sure it also has a loopback link; this loopback @@ -50,18 +56,16 @@ public: * After this function returns, any node in the graph * will have a loopback attached to it. */ - void addLoopback(); - void getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t route, double *lat); - xbt_dynar_t getOnelinkRoutes(); - void getRouteAndLatency(sg_platf_route_cbarg_t route, double *lat); - void parseASroute(sg_platf_route_cbarg_t route); - void parseRoute(sg_platf_route_cbarg_t route); - void end(); + void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t route, double *lat) override; + xbt_dynar_t getOneLinkRoutes() override; + void addRoute(sg_platf_route_cbarg_t route) override; - xbt_graph_t p_routeGraph; /* xbt_graph */ - xbt_dict_t p_graphNodeMap; /* map */ - xbt_dict_t p_routeCache; /* use in cache mode */ - int m_cached; + xbt_graph_t routeGraph_ = nullptr; /* xbt_graph */ + xbt_dict_t graphNodeMap_ = nullptr; /* map */ + xbt_dict_t routeCache_ = nullptr; /* use in cache mode */ }; +} +} + #endif /* SURF_ROUTING_DIJKSTRA_HPP_ */