Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
c84527bfc35d3291b557ad5f14bf35f4de53dbda
[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 LinkImpl {
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                   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
37   s4u::Link::SharingPolicy get_sharing_policy() override;
38   void apply_event(kernel::profile::Event*, double) override { THROW_UNIMPLEMENTED; }
39   void set_bandwidth(double) override { THROW_UNIMPLEMENTED; }
40   void set_latency(double) override { THROW_UNIMPLEMENTED; }
41 };
42
43 } // namespace resource
44 } // namespace kernel
45 } // namespace simgrid
46 #endif /* SURF_NETWORK_WIFI_HPP_ */