Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines for 2022.
[simgrid.git] / include / simgrid / kernel / routing / WifiZone.hpp
1 /* Copyright (c) 2013-2022. 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_WIFI_HPP_
7 #define SIMGRID_ROUTING_WIFI_HPP_
8
9 #include <simgrid/kernel/routing/RoutedZone.hpp>
10
11 namespace simgrid {
12 namespace kernel {
13 namespace routing {
14
15 /** @ingroup ROUTING_API
16  *  @brief NetZone modeling a Wifi zone
17  *
18  *  This routing has only one link, representing the wifi medium (ie, the air).
19  *  That link is used for all communications within the zone.
20  */
21 class XBT_PRIVATE WifiZone : public RoutedZone {
22   resource::StandardLinkImpl* wifi_link_ = nullptr; // Representing the air media (there is no such thing in NS-3)
23   NetPoint* access_point_        = nullptr; // Zone's gateway to the external world
24
25   void do_seal() override;
26
27 public:
28   using RoutedZone::RoutedZone;
29   WifiZone(const WifiZone&) = delete;
30   WifiZone& operator=(const WifiZone) = delete;
31
32   void get_local_route(const NetPoint* src, const NetPoint* dst, Route* into, double* latency) override;
33   s4u::Link* create_link(const std::string& name, const std::vector<double>& bandwidths) override;
34   NetPoint* get_access_point() const { return access_point_; }
35 };
36 } // namespace routing
37 } // namespace kernel
38 } // namespace simgrid
39
40 #endif /* SIMGRID_ROUTING_WIFI_HPP_ */