X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/242fde5e8077f8193db4df5f262a9672085c8d8a..7d57ca811234dbffc0e041914391e0fe47c2d3ae:/src/surf/surf_routing_full.cpp diff --git a/src/surf/surf_routing_full.cpp b/src/surf/surf_routing_full.cpp index c7ef49a41b..a3ffd03c52 100644 --- a/src/surf/surf_routing_full.cpp +++ b/src/surf/surf_routing_full.cpp @@ -1,22 +1,20 @@ -/* 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 * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "surf_routing_full.hpp" -#include "network_interface.hpp" +#include "src/surf/surf_routing_private.hpp" +#include "src/surf/surf_routing_full.hpp" +#include "src/surf/network_interface.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_full, surf, "Routing part of surf"); -/* Global vars */ -extern routing_platf_t routing_platf; - #define TO_ROUTE_FULL(i,j) p_routingTable[(i)+(j)*table_size] AS_t model_full_create(void) { - return new AsFull(); + return new simgrid::surf::AsFull(); } void model_full_end(AS_t _routing) @@ -25,7 +23,7 @@ void model_full_end(AS_t _routing) sg_platf_route_cbarg_t e_route; /* set utils vars */ - AsFull *routing = static_cast(_routing); + simgrid::surf::AsFull *routing = static_cast(_routing); int table_size = (int)xbt_dynar_length(routing->p_indexNetworkElm); /* Create table if necessary */ @@ -48,9 +46,8 @@ void model_full_end(AS_t _routing) } } -AsFull::AsFull(){ - p_routingTable = 0; -} +namespace simgrid { +namespace surf { AsFull::~AsFull(){ if (p_routingTable) { @@ -83,9 +80,9 @@ xbt_dynar_t AsFull::getOneLinkRoutes() void *link = *(void **) xbt_dynar_get_ptr(route->link_list, 0); Onelink *onelink; if (p_hierarchy == SURF_ROUTING_BASE) { - RoutingEdge *tmp_src = xbt_dynar_get_as(p_indexNetworkElm, src, sg_routing_edge_t); + NetCard *tmp_src = xbt_dynar_get_as(p_indexNetworkElm, src, sg_netcard_t); tmp_src->setId(src); - RoutingEdge *tmp_dst = xbt_dynar_get_as(p_indexNetworkElm, dst, sg_routing_edge_t); + NetCard *tmp_dst = xbt_dynar_get_as(p_indexNetworkElm, dst, sg_netcard_t); tmp_dst->setId(dst); onelink = new Onelink(link, tmp_src, tmp_dst); } else if (p_hierarchy == SURF_ROUTING_RECURSIVE) @@ -103,7 +100,7 @@ xbt_dynar_t AsFull::getOneLinkRoutes() return ret; } -void AsFull::getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t res, double *lat) +void AsFull::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t res, double *lat) { XBT_DEBUG("full_get_route_and_latency from %s[%d] to %s[%d]", src->getName(), @@ -145,9 +142,9 @@ void AsFull::parseRoute(sg_platf_route_cbarg_t route) int as_route = 0; char *src = (char*)(route->src); char *dst = (char*)(route->dst); - RoutingEdge *src_net_elm, *dst_net_elm; - src_net_elm = sg_routing_edge_by_name_or_null(src); - dst_net_elm = sg_routing_edge_by_name_or_null(dst); + NetCard *src_net_elm, *dst_net_elm; + src_net_elm = sg_netcard_by_name_or_null(src); + dst_net_elm = sg_netcard_by_name_or_null(dst); xbt_assert(src_net_elm, "Network elements %s not found", src); xbt_assert(dst_net_elm, "Network elements %s not found", dst); @@ -233,7 +230,7 @@ void AsFull::parseRoute(sg_platf_route_cbarg_t route) || (route->symmetrical == TRUE && as_route == 1) ) { if (route->gw_dst && route->gw_src) { - sg_routing_edge_t gw_tmp; + sg_netcard_t gw_tmp; gw_tmp = route->gw_src; route->gw_src = route->gw_dst; route->gw_dst = gw_tmp; @@ -267,6 +264,5 @@ void AsFull::parseRoute(sg_platf_route_cbarg_t route) xbt_dynar_free(&route->link_list); } - - - +} +}