Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix cxx flag for win build
[simgrid.git] / src / surf / surf_routing_cluster.cpp
index 110e685..b910808 100644 (file)
@@ -1,13 +1,12 @@
-/* Copyright (c) 2009, 2010, 2011. The SimGrid Team.
+/* Copyright (c) 2009, 2010, 2011, 2013. 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. */
 
 #include "surf_routing_cluster.hpp"
 
-extern "C" {
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster, surf, "Routing part of surf");
-}
 
 /* This routing is specifically setup to represent clusters, aka homogeneous sets of machines
  * Note that a router is created, easing the interconnexion with the rest of the world.
@@ -39,7 +38,7 @@ void AsCluster::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_pl
     if((src->m_id == dst->m_id) && info.loopback_link  ){
       xbt_dynar_push_as(route->link_list, void *, info.loopback_link);
       if (lat)
-        *lat += dynamic_cast<NetworkCm02LinkPtr>(static_cast<ResourcePtr>(info.loopback_link))->getLatency();
+        *lat += dynamic_cast<NetworkLinkPtr>(static_cast<ResourcePtr>(info.loopback_link))->getLatency();
       return;
     }
 
@@ -50,7 +49,7 @@ void AsCluster::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_pl
     if (info.link_up) {         // link up
       xbt_dynar_push_as(route->link_list, void *, info.link_up);
       if (lat)
-        *lat += dynamic_cast<NetworkCm02LinkPtr>(static_cast<ResourcePtr>(info.link_up))->getLatency();
+        *lat += dynamic_cast<NetworkLinkPtr>(static_cast<ResourcePtr>(info.link_up))->getLatency();
     }
   }
 
@@ -66,7 +65,7 @@ void AsCluster::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_pl
     if (info.link_down) {       // link down
       xbt_dynar_push_as(route->link_list, void *, info.link_down);
       if (lat)
-        *lat += dynamic_cast<NetworkCm02LinkPtr>(static_cast<ResourcePtr>(info.link_down))->getLatency();
+        *lat += dynamic_cast<NetworkLinkPtr>(static_cast<ResourcePtr>(info.link_down))->getLatency();
     }
 
     if (info.limiter_link)          // limiter for receiver
@@ -91,7 +90,7 @@ void AsCluster::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
   routerNode = new_xbt_graph_node(graph, link_name, nodes);
 
   if(p_backbone) {
-    const char *link_nameR = p_backbone->m_name;
+    const char *link_nameR = p_backbone->getName();
     backboneNode = new_xbt_graph_node(graph, link_nameR, nodes);
 
     new_xbt_graph_edge(graph, routerNode, backboneNode, edges);
@@ -107,7 +106,7 @@ void AsCluster::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
 
       if (info.link_up) {     // link up
 
-        const char *link_name = ((ResourcePtr) info.link_up)->m_name;
+        const char *link_name = static_cast<ResourcePtr>(info.link_up)->getName();
         current = new_xbt_graph_node(graph, link_name, nodes);
         new_xbt_graph_edge(graph, previous, current, edges);
 
@@ -120,7 +119,7 @@ void AsCluster::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
       }
 
       if (info.link_down) {    // link down
-        const char *link_name = ((ResourcePtr) info.link_down)->m_name;
+        const char *link_name = static_cast<ResourcePtr>(info.link_down)->getName();
         current = new_xbt_graph_node(graph, link_name, nodes);
         new_xbt_graph_edge(graph, previous, current, edges);