X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/dc9b8feaddd53842f6204f4f24409b2382393fa9..40ee10e13b61bfb28374d96ade010a262b5abd44:/include/simgrid/kernel/routing/FloydZone.hpp diff --git a/include/simgrid/kernel/routing/FloydZone.hpp b/include/simgrid/kernel/routing/FloydZone.hpp index b16ea00ce3..6cfaa76075 100644 --- a/include/simgrid/kernel/routing/FloydZone.hpp +++ b/include/simgrid/kernel/routing/FloydZone.hpp @@ -1,16 +1,14 @@ -/* Copyright (c) 2013-2019. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2013-2023. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#ifndef SURF_ROUTING_FLOYD_HPP_ -#define SURF_ROUTING_FLOYD_HPP_ +#ifndef SIMGRID_ROUTING_FLOYD_HPP_ +#define SIMGRID_ROUTING_FLOYD_HPP_ #include -namespace simgrid { -namespace kernel { -namespace routing { +namespace simgrid::kernel::routing { /** @ingroup ROUTING_API * @brief NetZone with an explicit routing computed at initialization with Floyd-Warshal @@ -22,25 +20,23 @@ namespace routing { * (somewhere between the one of @{DijkstraZone} and the one of @{FullZone}). */ class XBT_PRIVATE FloydZone : public RoutedZone { + /* vars to compute the Floyd algorithm. */ + std::vector> predecessor_table_; + std::vector> cost_table_; + std::vector>> link_table_; + + void init_tables(unsigned int table_size); + void do_seal() override; + public: - explicit FloydZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel); + using RoutedZone::RoutedZone; FloydZone(const FloydZone&) = delete; FloydZone& operator=(const FloydZone&) = delete; - ~FloydZone() override; - void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override; + void get_local_route(const NetPoint* src, const NetPoint* dst, Route* into, double* latency) override; void add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst, - std::vector& link_list, bool symmetrical) override; - void seal() override; - -private: - /* vars to compute the Floyd algorithm. */ - int* predecessor_table_; - double* cost_table_; - RouteCreationArgs** link_table_; + const std::vector& link_list, bool symmetrical) override; }; -} // namespace routing -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::routing -#endif /* SURF_ROUTING_FLOYD_HPP_ */ +#endif /* SIMGRID_ROUTING_FLOYD_HPP_ */