Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
start initializing routing fields in the constructors, not with a shotgun
[simgrid.git] / src / surf / surf_routing_generic.cpp
index fb94ab5..262042a 100644 (file)
@@ -24,7 +24,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_routing_generic, surf_route, "Generic imple
 
 static int no_bypassroute_declared = 1;
 
-void generic_free_route(sg_platf_route_cbarg_t route)
+void routing_route_free(sg_platf_route_cbarg_t route)
 {
   if (route) {
     xbt_dynar_free(&route->link_list);
@@ -47,11 +47,14 @@ void AsGeneric::getRouteAndLatency(NetCard */*src*/, NetCard */*dst*/, sg_platf_
   THROW_IMPOSSIBLE;
 }
 
-AsGeneric::AsGeneric() {
-  p_bypassRoutes = xbt_dict_new_homogeneous((void (*)(void *)) generic_free_route);
+AsGeneric::AsGeneric(const char*name)
+  : AsNone(name)
+{
+  p_bypassRoutes = xbt_dict_new_homogeneous((void (*)(void *)) routing_route_free);
 }
 
-AsGeneric::~AsGeneric() {
+AsGeneric::~AsGeneric()
+{
   xbt_dict_free(&p_bypassRoutes);
 }