Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
small cleanups in dijkstra
[simgrid.git] / src / surf / surf_routing_dijkstra.hpp
index a5ef07e..dd1523b 100644 (file)
@@ -34,14 +34,16 @@ namespace surf {
 
 class XBT_PRIVATE AsDijkstra;
 
 
 class XBT_PRIVATE AsDijkstra;
 
+/** Dijkstra routing data: fast initialization, slow lookup, small memory requirements, shortest path routing only */
 class AsDijkstra : public AsGeneric {
 public:
 class AsDijkstra : public AsGeneric {
 public:
-  AsDijkstra();
-  AsDijkstra(bool cached);
+  AsDijkstra(const char*name, bool cached);
+  void Seal() override;
+
   ~AsDijkstra();
   ~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
     /**
      * For each vertex (node) already in the graph,
      * make sure it also has a loopback link; this loopback
@@ -54,18 +56,14 @@ public:
      * After this function returns, any node in the graph
      * will have a loopback attached to it.
      */
      * After this function returns, any node in the graph
      * will have a loopback attached to it.
      */
-       void addLoopback();
-       void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t route, double *lat) override;
-       xbt_dynar_t getOneLinkRoutes() override;
-       void getRouteAndLatency(sg_platf_route_cbarg_t route, double *lat); // FIXME: this function is dangerously not overriding because of diverging prototype
-       void parseASroute(sg_platf_route_cbarg_t route) override;
-       void parseRoute(sg_platf_route_cbarg_t route) override;
-       void end();
+  void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t route, double *lat) override;
+  void getRouteAndLatency(sg_platf_route_cbarg_t route, double *lat); // FIXME: this function is dangerously not overriding because of diverging prototype
+  xbt_dynar_t getOneLinkRoutes() override;
+  void parseRoute(sg_platf_route_cbarg_t route) override;
 
 
-  xbt_graph_t p_routeGraph = nullptr;      /* xbt_graph */
-  xbt_dict_t p_graphNodeMap = nullptr;    /* map */
-  xbt_dict_t p_routeCache = nullptr;       /* use in cache mode */
-  bool m_cached = false;
+  xbt_graph_t routeGraph_ = nullptr;     /* xbt_graph */
+  xbt_dict_t graphNodeMap_ = nullptr;    /* map */
+  xbt_dict_t routeCache_ = nullptr;      /* use in cache mode */
 };
 
 }
 };
 
 }