X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d785a64b1830b6a5d05561316ef7161ee1c67671..15822682005a67cef0250f877746f1d37fe412d4:/src/kernel/routing/AsFull.cpp diff --git a/src/kernel/routing/AsFull.cpp b/src/kernel/routing/AsFull.cpp index e0b6cda7fe..a87cec6650 100644 --- a/src/kernel/routing/AsFull.cpp +++ b/src/kernel/routing/AsFull.cpp @@ -13,9 +13,8 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_full, surf, "Routing part of surf"); namespace simgrid { namespace kernel { namespace routing { - AsFull::AsFull(const char*name) - : AsRoutedGraph(name) - { +AsFull::AsFull(As* father, const char* name) : AsRoutedGraph(father, name) +{ } void AsFull::seal() { @@ -23,7 +22,7 @@ void AsFull::seal() { sg_platf_route_cbarg_t e_route; /* set utils vars */ - int table_size = (int)xbt_dynar_length(vertices_); + int table_size = static_cast(vertices_.size()); /* Create table if necessary */ if (!routingTable_) @@ -47,11 +46,10 @@ void AsFull::seal() { AsFull::~AsFull(){ if (routingTable_) { - int table_size = (int)xbt_dynar_length(vertices_); - int i, j; + int table_size = static_cast(vertices_.size()); /* Delete routing table */ - for (i = 0; i < table_size; i++) - for (j = 0; j < table_size; j++) { + for (int i = 0; i < table_size; i++) + for (int j = 0; j < table_size; j++) { if (TO_ROUTE_FULL(i,j)){ delete TO_ROUTE_FULL(i,j)->link_list; xbt_free(TO_ROUTE_FULL(i,j)); @@ -67,7 +65,7 @@ void AsFull::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg src->name(), src->id(), dst->name(), dst->id()); /* set utils vars */ - size_t table_size = xbt_dynar_length(vertices_); + size_t table_size = vertices_.size(); sg_platf_route_cbarg_t e_route = nullptr; @@ -79,7 +77,7 @@ void AsFull::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg for (auto link : *e_route->link_list) { res->link_list->push_back(link); if (lat) - *lat += static_cast(link)->getLatency(); + *lat += static_cast(link)->latency(); } } } @@ -93,7 +91,7 @@ void AsFull::addRoute(sg_platf_route_cbarg_t route) addRouteCheckParams(route); - size_t table_size = xbt_dynar_length(vertices_); + size_t table_size = vertices_.size(); if (!routingTable_) routingTable_ = xbt_new0(sg_platf_route_cbarg_t, table_size * table_size);