X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/63fbd4caffa4791c08f14fefabe945c0512f3186..6985b5de45eda7769cd98891461948ae298eb8c3:/include/simgrid/kernel/routing/StarZone.hpp diff --git a/include/simgrid/kernel/routing/StarZone.hpp b/include/simgrid/kernel/routing/StarZone.hpp index 5afe23f885..9327c3b8ac 100644 --- a/include/simgrid/kernel/routing/StarZone.hpp +++ b/include/simgrid/kernel/routing/StarZone.hpp @@ -6,7 +6,7 @@ #ifndef SIMGRID_KERNEL_ROUTING_STARZONE_HPP_ #define SIMGRID_KERNEL_ROUTING_STARZONE_HPP_ -#include +#include #include #include @@ -60,18 +60,16 @@ namespace routing { * In this case, a communication from A to B goes through the links: l0, backbone, l1. * Note that the backbone only appears once in the link list. */ - -class StarZone : public NetZoneImpl { - +class StarZone : public ClusterZone { // implements the old ClusterZone public: explicit StarZone(const std::string& name); - void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* latency) override; + void get_local_route(const NetPoint* src, const NetPoint* dst, Route* route, double* latency) override; void get_graph(const s_xbt_graph_t* graph, std::map>* nodes, std::map>* edges) override; void add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst, - const std::vector& link_list, bool symmetrical) override; + const std::vector& link_list, bool symmetrical) override; void do_seal() override; private: @@ -83,20 +81,20 @@ private: bool links_up_set = false; //!< bool to indicate that links_up was configured (empty or not) bool links_down_set = false; //!< same for links_down NetPoint* gateway = nullptr; - bool has_loopback() const { return loopback.size() > 0; } + bool has_loopback() const { return not loopback.empty(); } bool has_links_up() const { return links_up_set; } bool has_links_down() const { return links_down_set; } }; /** @brief Auxiliary method to add links to a route */ - void add_links_to_route(const std::vector& links, RouteCreationArgs* route, double* latency, - std::unordered_set& added_links); + void add_links_to_route(const std::vector& links, Route* route, double* latency, + std::unordered_set& added_links) const; /** @brief Auxiliary methods to check params received in add_route method */ - void check_add_route_param(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst, - const std::vector& link_list, bool symmetrical); - std::unordered_map routes_; + void check_add_route_param(const NetPoint* src, const NetPoint* dst, const NetPoint* gw_src, const NetPoint* gw_dst, + bool symmetrical) const; + std::unordered_map routes_; }; } // namespace routing } // namespace kernel } // namespace simgrid -#endif /* SIMGRID_KERNEL_ROUTING_STARZONE_HPP_ */ \ No newline at end of file +#endif /* SIMGRID_KERNEL_ROUTING_STARZONE_HPP_ */