Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make model name constant
[simgrid.git] / src / surf / network_cm02.hpp
1 /* Copyright (c) 2013-2021. 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_CM02_HPP_
7 #define SURF_NETWORK_CM02_HPP_
8
9 #include <xbt/base.h>
10
11 #include "network_interface.hpp"
12 #include "xbt/graph.h"
13 #include "xbt/string.hpp"
14
15 /***********
16  * Classes *
17  ***********/
18
19 namespace simgrid {
20 namespace kernel {
21 namespace resource {
22
23 class XBT_PRIVATE NetworkCm02Model;
24 class XBT_PRIVATE NetworkCm02Action;
25 class XBT_PRIVATE NetworkSmpiModel;
26
27 /*********
28  * Model *
29  *********/
30
31 class NetworkCm02Model : public NetworkModel {
32 public:
33   explicit NetworkCm02Model(std::string name);
34   LinkImpl* create_link(const std::string& name, const std::vector<double>& bandwidths,
35                         s4u::Link::SharingPolicy policy) override;
36   void update_actions_state_lazy(double now, double delta) override;
37   void update_actions_state_full(double now, double delta) override;
38   Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
39 };
40
41 /************
42  * Resource *
43  ************/
44
45 class NetworkCm02Link : public LinkImpl {
46 public:
47   NetworkCm02Link(const std::string& name, double bandwidth, s4u::Link::SharingPolicy policy, lmm::System* system);
48   void apply_event(kernel::profile::Event* event, double value) override;
49   void set_bandwidth(double value) override;
50   LinkImpl* set_latency(double value) override;
51 };
52
53 /**********
54  * Action *
55  **********/
56 class NetworkCm02Action : public NetworkAction {
57   friend Action* NetworkCm02Model::communicate(s4u::Host* src, s4u::Host* dst, double size, double rate);
58
59 public:
60   using NetworkAction::NetworkAction;
61   void update_remains_lazy(double now) override;
62 };
63 }
64 }
65 } // namespace simgrid
66 #endif /* SURF_NETWORK_CM02_HPP_ */