X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/95f98f86ddeb28cea15e126929f48d196160a316..2f2ce19fcb66a634c19de8dda2dc4b4896203537:/src/surf/surf_routing.hpp diff --git a/src/surf/surf_routing.hpp b/src/surf/surf_routing.hpp index d61d3fa88e..d0ae19bf62 100644 --- a/src/surf/surf_routing.hpp +++ b/src/surf/surf_routing.hpp @@ -14,13 +14,13 @@ xbt_edge_t new_xbt_graph_edge (xbt_graph_t graph, xbt_node_t s, xbt_node_t d, xb /*********** * Classes * ***********/ -class As; +struct As; typedef As *AsPtr; class RoutingModelDescription; typedef RoutingModelDescription *RoutingModelDescriptionPtr; -class RoutingEdge; +struct RoutingEdge; typedef RoutingEdge *RoutingEdgePtr; class Onelink; @@ -29,15 +29,7 @@ typedef Onelink *OnelinkPtr; class RoutingPlatf; typedef RoutingPlatf *RoutingPlatfPtr; - -/*FIXME:class RoutingModelDescription { - const char *p_name; - const char *p_desc; - AsPtr create(); - void end(AsPtr as); -};*/ - -class As { +struct As { public: xbt_dynar_t p_indexNetworkElm; xbt_dict_t p_bypassRoutes; /* store bypass routes */ @@ -50,7 +42,9 @@ public: xbt_dynar_t p_linkUpDownList; As(){}; - ~As(){}; + virtual ~As(){ + xbt_free(p_name); + }; virtual void getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_platf_route_cbarg_t into, double *latency)=0; virtual xbt_dynar_t getOneLinkRoutes()=0; @@ -68,8 +62,9 @@ public: virtual void parseBypassroute(sg_platf_route_cbarg_t e_route)=0; }; -class RoutingEdge { +struct RoutingEdge { public: + ~RoutingEdge() { xbt_free(p_name);}; AsPtr p_rcComponent; e_surf_network_element_type_t p_rcType; int m_id; @@ -82,7 +77,7 @@ public: class Onelink { public: Onelink(void *link, RoutingEdgePtr src, RoutingEdgePtr dst) - : p_link(link), p_src(src), p_dst(dst) {}; + : p_src(src), p_dst(dst), p_link(link) {}; RoutingEdgePtr p_src; RoutingEdgePtr p_dst; void *p_link; @@ -90,6 +85,7 @@ public: class RoutingPlatf { public: + ~RoutingPlatf(); AsPtr p_root; void *p_loopback; xbt_dynar_t p_lastRoute;