Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[surf] Move some code in a simgrid::surf namespace
[simgrid.git] / src / surf / surf_routing_dijkstra.cpp
index f6d146d..28ed732 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2014. The SimGrid Team.
+/* Copyright (c) 2009-2015. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -7,9 +7,6 @@
 #include "surf_routing_dijkstra.hpp"
 #include "network_interface.hpp"
 
-/* Global vars */
-extern routing_platf_t routing_platf;
-
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_dijkstra, surf, "Routing part of surf -- dijkstra routing logic");
 
 /* Free functions */
@@ -39,16 +36,17 @@ static void graph_edge_data_free(void *e) // FIXME: useless code duplication
 }
 
 AS_t model_dijkstra_create(void){
-  return new AsDijkstra(0);
+  return new simgrid::surf::AsDijkstra(0);
 }
 
 AS_t model_dijkstracache_create(void){
-  return new AsDijkstra(1);
+  return new simgrid::surf::AsDijkstra(1);
 }
 
 void model_dijkstra_both_end(AS_t as)
 {
-  AsDijkstra *THIS_AS = static_cast<AsDijkstra*>(as);
+  simgrid::surf::AsDijkstra *THIS_AS
+    = static_cast<simgrid::surf::AsDijkstra*>(as);
   xbt_node_t node = NULL;
   unsigned int cursor2;
   xbt_dynar_t nodes = NULL;
@@ -77,6 +75,9 @@ void model_dijkstra_both_end(AS_t as)
 
 /* Utility functions */
 
+namespace simgrid {
+namespace surf {
+
 xbt_node_t AsDijkstra::routeGraphNewNode(int id, int graph_id)
 {
   xbt_node_t node = NULL;
@@ -531,3 +532,6 @@ void AsDijkstra::parseRoute(sg_platf_route_cbarg_t route)
   }
   xbt_dynar_free(&route->link_list);
 }
+
+}
+}