Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
surf_parse_error() never returns, remove dead code after that.
[simgrid.git] / src / kernel / routing / DijkstraZone.cpp
index 54396c5..a63574b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2018. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2009-2019. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -21,13 +21,13 @@ namespace routing {
 
 class GraphNodeData {
 public:
-  GraphNodeData(int id) : id_(id) {}
+  explicit GraphNodeData(int id) : id_(id) {}
   int id_;
   int graph_id_ = -1; /* used for caching internal graph id's */
 };
 
-DijkstraZone::DijkstraZone(NetZoneImpl* father, std::string name, bool cached)
-    : RoutedZone(father, name), cached_(cached)
+DijkstraZone::DijkstraZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel, bool cached)
+    : RoutedZone(father, std::move(name), netmodel), cached_(cached)
 {
 }
 
@@ -55,7 +55,7 @@ void DijkstraZone::seal()
     route_graph_ = xbt_graph_new_graph(1, nullptr);
 
   /* Add the loopback if needed */
-  if (surf_network_model->loopback_ && hierarchy_ == RoutingMode::base) {
+  if (network_model_->loopback_ && hierarchy_ == RoutingMode::base) {
 
     xbt_dynar_foreach (xbt_graph_get_nodes(route_graph_), cursor, node) {
       bool found = false;
@@ -69,9 +69,9 @@ void DijkstraZone::seal()
       }
 
       if (not found) {
-        RouteCreationArgs* e_route = new simgrid::kernel::routing::RouteCreationArgs();
-        e_route->link_list.push_back(surf_network_model->loopback_);
-        xbt_graph_new_edge(route_graph_, node, node, e_route);
+        RouteCreationArgs* route = new simgrid::kernel::routing::RouteCreationArgs();
+        route->link_list.push_back(network_model_->loopback_);
+        xbt_graph_new_edge(route_graph_, node, node, route);
       }
     }
   }