Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use ssize_t.
[simgrid.git] / include / simgrid / kernel / routing / WifiZone.hpp
1 /* Copyright (c) 2013-2020. 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 public:
23   explicit WifiZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel);
24   WifiZone(const WifiZone&) = delete;
25   WifiZone& operator=(const WifiZone) = delete;
26   ~WifiZone() override                = default;
27
28   void seal() override;
29   void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
30   s4u::Link* create_link(const std::string& name, const std::vector<double>& bandwidths, double latency,
31                          s4u::Link::SharingPolicy policy,
32                          const std::unordered_map<std::string, std::string>* props) override;
33
34 private:
35   resource::LinkImpl* wifi_link_ = nullptr; // Representing the air media (there is no such thing in NS-3)
36   NetPoint* access_point_        = nullptr; // Zone's gateway to the external world
37 };
38 } // namespace routing
39 } // namespace kernel
40 } // namespace simgrid
41
42 #endif /* SIMGRID_ROUTING_WIFI_HPP_ */