Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
useless cosmetics hinted by qtcreator
[simgrid.git] / src / surf / network_constant.hpp
1 /* Copyright (c) 2013-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 NETWORK_CONSTANT_HPP_
7 #define NETWORK_CONSTANT_HPP_
8
9 #include <xbt/base.h>
10
11 #include "network_interface.hpp"
12
13 namespace simgrid {
14 namespace kernel {
15 namespace resource {
16
17 class NetworkConstantModel : public NetworkModel {
18 public:
19   NetworkConstantModel();
20   Action* communicate(simgrid::s4u::Host* src, simgrid::s4u::Host* dst, double size, double rate) override;
21   double next_occuring_event(double now) override;
22   void update_actions_state(double now, double delta) override;
23
24   LinkImpl* create_link(const std::string& name, double bw, double lat, s4u::Link::SharingPolicy policy) override;
25 };
26
27 class NetworkConstantAction : public NetworkAction {
28 public:
29   NetworkConstantAction(NetworkConstantModel* model_, double size, double latency);
30   ~NetworkConstantAction();
31   double initial_latency_;
32   void update_remains_lazy(double now) override;
33 };
34
35 } // namespace resource
36 } // namespace kernel
37 } // namespace simgrid
38
39 #endif /* NETWORK_CONSTANT_HPP_ */