]> AND Public Git Repository - simgrid.git/blobdiff - src/surf/surf_routing.hpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
make cluster routing a bit more flexible, to allow adding other kinds of clusters
[simgrid.git] / src / surf / surf_routing.hpp
index 6f7a5682fd33d2e4f0409fc80706dbe3c45f5e23..8c2c90f9a53d4caab9124700a2bdcfd070919789 100644 (file)
@@ -1,4 +1,4 @@
-#include "surf.hpp"
+#include "surf_interface.hpp"
 #include <float.h>
 
 #ifndef NETWORK_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(){};
-  virtual ~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;
@@ -90,6 +85,7 @@ public:
 
 class RoutingPlatf {
 public:
+  ~RoutingPlatf();
   AsPtr p_root;
   void *p_loopback;
   xbt_dynar_t p_lastRoute;