Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
simplify constant model a bit
[simgrid.git] / src / surf / network_constant.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 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   using NetworkModel::NetworkModel;
20   Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
21   double next_occurring_event(double now) override;
22   void update_actions_state(double now, double delta) override;
23
24   LinkImpl* create_link(const std::string& name, const std::vector<double>& bws,
25                         s4u::Link::SharingPolicy policy) override;
26 };
27
28 class NetworkConstantAction : public NetworkAction {
29 public:
30   NetworkConstantAction(NetworkConstantModel* model_, s4u::Host& src, s4u::Host& dst, double size);
31   ~NetworkConstantAction() override;
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_ */