Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of https://framagit.org/simgrid/simgrid
[simgrid.git] / include / simgrid / kernel / routing / FullZone.hpp
1 /* Copyright (c) 2013-2023. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef SIMGRID_ROUTING_FULL_HPP_
7 #define SIMGRID_ROUTING_FULL_HPP_
8
9 #include <simgrid/kernel/routing/RoutedZone.hpp>
10
11 namespace simgrid::kernel::routing {
12
13 /** @ingroup ROUTING_API
14  *  @brief NetZone with an explicit routing provided by the user
15  *
16  *  The full communication matrix is provided at creation, so this model has the highest expressive power and the lowest
17  *  computational requirements, but also the highest memory requirements (both in platform file and in memory).
18  */
19 class XBT_PRIVATE FullZone : public RoutedZone {
20   std::vector<std::vector<std::unique_ptr<Route>>> routing_table_;
21   void do_seal() override;
22   /** @brief Check and resize (if necessary) the routing table */
23   void check_routing_table();
24
25 public:
26   using RoutedZone::RoutedZone;
27   FullZone(const FullZone&) = delete;
28   FullZone& operator=(const FullZone) = delete;
29
30   void get_local_route(const NetPoint* src, const NetPoint* dst, Route* into, double* latency) override;
31   void add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
32                  const std::vector<s4u::LinkInRoute>& link_list, bool symmetrical) override;
33 };
34 } // namespace simgrid::kernel::routing
35
36 #endif /* SIMGRID_ROUTING_FULL_HPP_ */