Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
33e672d9327d95bdd399826bb61eec148f9c25a9
[simgrid.git] / src / surf / network_wifi.hpp
1 /* Copyright (c) 2019. 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 SURF_NETWORK_WIFI_HPP_
7 #define SURF_NETWORK_WIFI_HPP_
8
9 #include <xbt/base.h>
10
11 #include "network_cm02.hpp"
12 #include "xbt/string.hpp"
13
14 /***********
15  * Classes *
16  ***********/
17
18 namespace simgrid {
19 namespace kernel {
20 namespace resource {
21
22 class NetworkWifiLink : public NetworkCm02Link {
23   /** @brief Hold every rates association between host and links (host name, rates id) */
24   std::map<xbt::string, int> host_rates_;
25
26   /** @brief A link can have several bandwith attach to it (mostly use by wifi model) */
27   std::vector<Metric> bandwidths_;
28
29 public:
30   NetworkWifiLink(NetworkCm02Model* model, const std::string& name, std::vector<double> bandwidths,
31                   s4u::Link::SharingPolicy policy, lmm::System* system);
32
33   void set_host_rate(s4u::Host* host, int rate_level);
34   /** @brief Get the AP rate associated to the host (or -1 if not associated to the AP) */
35   double get_host_rate(s4u::Host* host);
36   s4u::Link::SharingPolicy get_sharing_policy() override;
37 };
38
39 } // namespace resource
40 } // namespace kernel
41 } // namespace simgrid
42 #endif /* SURF_NETWORK_WIFI_HPP_ */