Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Constify list of links parameter
authorBruno Donassolo <bruno.donassolo@inria.fr>
Fri, 2 Apr 2021 16:41:04 +0000 (18:41 +0200)
committerBruno Donassolo <bruno.donassolo@inria.fr>
Fri, 2 Apr 2021 16:51:26 +0000 (18:51 +0200)
include/simgrid/kernel/routing/DijkstraZone.hpp
include/simgrid/kernel/routing/FloydZone.hpp
include/simgrid/kernel/routing/FullZone.hpp
include/simgrid/kernel/routing/NetZoneImpl.hpp
include/simgrid/s4u/NetZone.hpp
src/kernel/routing/DijkstraZone.cpp
src/kernel/routing/FloydZone.cpp
src/kernel/routing/FullZone.cpp
src/kernel/routing/NetZoneImpl.cpp
src/s4u/s4u_Netzone.cpp

index 6ae3a92..16a435f 100644 (file)
@@ -8,7 +8,6 @@
 
 #include <simgrid/kernel/routing/RoutedZone.hpp>
 
-
 namespace simgrid {
 namespace kernel {
 namespace routing {
@@ -52,7 +51,7 @@ public:
    */
   void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat) override;
   void add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
-                 std::vector<resource::LinkImpl*>& link_list, bool symmetrical) override;
+                 const std::vector<resource::LinkImpl*>& link_list, bool symmetrical) override;
 };
 } // namespace routing
 } // namespace kernel
index 19c7f20..17ade54 100644 (file)
@@ -38,7 +38,7 @@ public:
 
   void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
   void add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
-                 std::vector<resource::LinkImpl*>& link_list, bool symmetrical) override;
+                 const std::vector<resource::LinkImpl*>& link_list, bool symmetrical) override;
 };
 } // namespace routing
 } // namespace kernel
index b86d243..13565c4 100644 (file)
@@ -27,7 +27,7 @@ public:
 
   void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
   void add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
-                 std::vector<resource::LinkImpl*>& link_list, bool symmetrical) override;
+                 const std::vector<resource::LinkImpl*>& link_list, bool symmetrical) override;
 
 private:
   std::vector<RouteCreationArgs*> routing_table_;
index 6853d5c..2e9b75b 100644 (file)
@@ -154,7 +154,7 @@ public:
   virtual int add_component(kernel::routing::NetPoint* elm); /* A host, a router or a netzone, whatever */
   virtual void add_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
                          kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
-                         std::vector<kernel::resource::LinkImpl*>& link_list, bool symmetrical);
+                         const std::vector<kernel::resource::LinkImpl*>& link_list, bool symmetrical);
   /** @brief Set parent of this Netzone */
   void set_parent(NetZoneImpl* parent);
   /** @brief Set network model for this Netzone */
index 2e23d7c..a78e29d 100644 (file)
@@ -94,7 +94,7 @@ public:
                          const std::vector<Link*>& link_list, bool symmetrical = true);
 
   void add_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, kernel::routing::NetPoint* gw_src,
-                 kernel::routing::NetPoint* gw_dst, std::vector<kernel::resource::LinkImpl*>& link_list,
+                 kernel::routing::NetPoint* gw_dst, const std::vector<kernel::resource::LinkImpl*>& link_list,
                  bool symmetrical);
   void add_bypass_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
                         kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
index 4a6a2ad..3b6a036 100644 (file)
@@ -219,7 +219,7 @@ void DijkstraZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationAr
 }
 
 void DijkstraZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
-                             std::vector<resource::LinkImpl*>& link_list, bool symmetrical)
+                             const std::vector<resource::LinkImpl*>& link_list, bool symmetrical)
 {
   add_route_check_params(src, dst, gw_src, gw_dst, link_list, symmetrical);
 
index 1b4bc8f..98903cb 100644 (file)
@@ -82,7 +82,7 @@ void FloydZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs*
 }
 
 void FloydZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
-                          std::vector<resource::LinkImpl*>& link_list, bool symmetrical)
+                          const std::vector<resource::LinkImpl*>& link_list, bool symmetrical)
 {
   /* set the size of table routing */
   unsigned int table_size = get_table_size();
index e3abf98..9f0c860 100644 (file)
@@ -64,7 +64,7 @@ void FullZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs*
 }
 
 void FullZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
-                         std::vector<resource::LinkImpl*>& link_list, bool symmetrical)
+                         const std::vector<resource::LinkImpl*>& link_list, bool symmetrical)
 {
   add_route_check_params(src, dst, gw_src, gw_dst, link_list, symmetrical);
 
index a5996aa..7280225 100644 (file)
@@ -173,7 +173,7 @@ int NetZoneImpl::add_component(NetPoint* elm)
 }
 
 void NetZoneImpl::add_route(NetPoint* /*src*/, NetPoint* /*dst*/, NetPoint* /*gw_src*/, NetPoint* /*gw_dst*/,
-                            std::vector<resource::LinkImpl*>& /*link_list*/, bool /*symmetrical*/)
+                            const std::vector<resource::LinkImpl*>& /*link_list*/, bool /*symmetrical*/)
 {
   xbt_die("NetZone '%s' does not accept new routes (wrong class).", get_cname());
 }
index 0866435..fa6f0c2 100644 (file)
@@ -111,21 +111,19 @@ std::vector<kernel::resource::LinkImpl*> NetZone::get_link_list_impl(const std::
 void NetZone::add_regular_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
                                 const std::vector<Link*>& link_list, bool symmetrical)
 {
-  auto links = NetZone::get_link_list_impl(link_list);
-  add_route(src, dst, nullptr, nullptr, links, symmetrical);
+  add_route(src, dst, nullptr, nullptr, NetZone::get_link_list_impl(link_list), symmetrical);
 }
 
 void NetZone::add_netzone_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
                                 kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
                                 const std::vector<Link*>& link_list, bool symmetrical)
 {
-  auto links = NetZone::get_link_list_impl(link_list);
-  add_route(src, dst, gw_src, gw_dst, links, symmetrical);
+  add_route(src, dst, gw_src, gw_dst, NetZone::get_link_list_impl(link_list), symmetrical);
 }
 
 void NetZone::add_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
                         kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
-                        std::vector<kernel::resource::LinkImpl*>& link_list, bool symmetrical)
+                        const std::vector<kernel::resource::LinkImpl*>& link_list, bool symmetrical)
 {
   pimpl_->add_route(src, dst, gw_src, gw_dst, link_list, symmetrical);
 }