Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Const.
[simgrid.git] / src / surf / disk_s19.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 #include <xbt/base.h>
7
8 #include "src/kernel/resource/DiskImpl.hpp"
9
10 #ifndef DISK_S19_HPP_
11 #define DISK_S19_HPP_
12
13 namespace simgrid {
14 namespace kernel {
15 namespace resource {
16
17 /***********
18  * Classes *
19  ***********/
20
21 class XBT_PRIVATE DiskS19Model;
22 class XBT_PRIVATE DiskS19;
23 class XBT_PRIVATE DiskS19Action;
24
25 /*********
26  * Model *
27  *********/
28
29 class DiskS19Model : public DiskModel {
30 public:
31   using DiskModel::DiskModel;
32   DiskImpl* create_disk(const std::string& name, double read_bandwidth, double write_bandwidth) override;
33
34   DiskAction* io_start(const DiskImpl* disk, sg_size_t size, s4u::Io::OpType type) override;
35
36   void update_actions_state(double now, double delta) override;
37 };
38
39 /************
40  * Resource *
41  ************/
42
43 class DiskS19 : public DiskImpl {
44   void update_penalties(double delta) const;
45
46 public:
47   using DiskImpl::DiskImpl;
48   void set_read_bandwidth(double value) override;
49   void set_write_bandwidth(double value) override;
50   void apply_event(kernel::profile::Event* triggered, double value) override;
51 };
52
53 /**********
54  * Action *
55  **********/
56
57 class DiskS19Action : public DiskAction {
58 public:
59   DiskS19Action(Model* model, double cost, bool failed);
60   void update_remains_lazy(double now) override;
61 };
62
63 } // namespace resource
64 } // namespace kernel
65 } // namespace simgrid
66 #endif /* DISK_S19_HPP_ */