Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
move one method higher in As hierarchy
authorMartin Quinson <martin.quinson@loria.fr>
Fri, 19 Feb 2016 23:27:32 +0000 (00:27 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Fri, 19 Feb 2016 23:27:34 +0000 (00:27 +0100)
+ rework the inheritance tree: models don't need to inherit of AsNone

src/surf/surf_routing.cpp
src/surf/surf_routing.hpp
src/surf/surf_routing_cluster.cpp
src/surf/surf_routing_cluster.hpp
src/surf/surf_routing_generic.cpp
src/surf/surf_routing_generic.hpp
src/surf/surf_routing_none.cpp
src/surf/surf_routing_none.hpp

index 4702142..2fa1297 100644 (file)
@@ -49,7 +49,9 @@ namespace surf {
   sg_platf_route_cbarg_t As::getBypassRoute(NetCard * /*src*/, NetCard * /*dst*/, double * /*lat*/) {
     return NULL;
   }
   sg_platf_route_cbarg_t As::getBypassRoute(NetCard * /*src*/, NetCard * /*dst*/, double * /*lat*/) {
     return NULL;
   }
-
+  xbt_dynar_t As::getOneLinkRoutes() {
+    return NULL;
+  }
 
   int As::addComponent(NetCard *elm) {
     XBT_DEBUG("Load component \"%s\"", elm->name());
 
   int As::addComponent(NetCard *elm) {
     XBT_DEBUG("Load component \"%s\"", elm->name());
index d87bcb3..8b30f5f 100644 (file)
@@ -92,7 +92,7 @@ public:
    */
   virtual void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency)=0;
   /** @brief retrieves the list of all routes of size 1 (of type src x dst x Link) */
    */
   virtual void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency)=0;
   /** @brief retrieves the list of all routes of size 1 (of type src x dst x Link) */
-  virtual xbt_dynar_t getOneLinkRoutes()=0;
+  virtual xbt_dynar_t getOneLinkRoutes();
 
   virtual void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)=0;
 
 
   virtual void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)=0;
 
index 1b648c5..9b364b1 100644 (file)
@@ -16,7 +16,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster, surf, "Routing part of surf"
 namespace simgrid {
 namespace surf {
   AsCluster::AsCluster(const char*name)
 namespace simgrid {
 namespace surf {
   AsCluster::AsCluster(const char*name)
-    : AsNone(name)
+    : As(name)
   {}
 
 void AsCluster::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t route, double *lat)
   {}
 
 void AsCluster::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t route, double *lat)
index bd2da0a..8ea4836 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <xbt/base.h>
 
 
 #include <xbt/base.h>
 
-#include "surf_routing_none.hpp"
+#include "surf_routing.hpp"
 #include "network_interface.hpp"
 
 namespace simgrid {
 #include "network_interface.hpp"
 
 namespace simgrid {
@@ -24,7 +24,7 @@ class XBT_PRIVATE AsCluster;
 /* ************************************************** */
 /* **************  Cluster ROUTING   **************** */
 
 /* ************************************************** */
 /* **************  Cluster ROUTING   **************** */
 
-class AsCluster: public AsNone {
+class AsCluster: public As {
 public:
   AsCluster(const char*name);
 
 public:
   AsCluster(const char*name);
 
index 3d7651c..526b4d2 100644 (file)
@@ -36,7 +36,7 @@ namespace simgrid {
 namespace surf {
   
 AsGeneric::AsGeneric(const char*name)
 namespace surf {
   
 AsGeneric::AsGeneric(const char*name)
-  : AsNone(name)
+  : As(name)
 {
 }
 
 {
 }
 
index 9d762b3..073a2d4 100644 (file)
@@ -6,7 +6,7 @@
 
 #include <xbt/base.h>
 
 
 #include <xbt/base.h>
 
-#include "surf_routing_none.hpp"
+#include "surf_routing.hpp"
 
 #ifndef SURF_ROUTING_GENERIC_HPP_
 #define SURF_ROUTING_GENERIC_HPP_
 
 #ifndef SURF_ROUTING_GENERIC_HPP_
 #define SURF_ROUTING_GENERIC_HPP_
@@ -16,7 +16,7 @@ namespace surf {
 
 class XBT_PRIVATE AsGeneric;
 
 
 class XBT_PRIVATE AsGeneric;
 
-class XBT_PRIVATE AsGeneric : public AsNone {
+class XBT_PRIVATE AsGeneric : public As {
 public:
   AsGeneric(const char*name);
   ~AsGeneric();
 public:
   AsGeneric(const char*name);
   ~AsGeneric();
index 8ff5272..887e9ac 100644 (file)
@@ -17,10 +17,6 @@ AsNone::AsNone(const char*name)
 AsNone::~AsNone()
 {}
 
 AsNone::~AsNone()
 {}
 
-xbt_dynar_t AsNone::getOneLinkRoutes() {
-  return NULL;
-}
-
 void AsNone::getRouteAndLatency(NetCard * /*src*/, NetCard * /*dst*/,
                                 sg_platf_route_cbarg_t /*res*/, double */*lat*/)
 {}
 void AsNone::getRouteAndLatency(NetCard * /*src*/, NetCard * /*dst*/,
                                 sg_platf_route_cbarg_t /*res*/, double */*lat*/)
 {}
index 6a82602..16b97a4 100644 (file)
@@ -21,7 +21,6 @@ public:
   ~AsNone();
 
   void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency) override;
   ~AsNone();
 
   void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency) override;
-  xbt_dynar_t getOneLinkRoutes() override;
   void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) override;
 };
 
   void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) override;
 };