Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
simplify the way I/O actions are created (CPU style)
[simgrid.git] / src / surf / disk_s19.hpp
1 /* Copyright (c) 2013-2022. 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::kernel::resource {
14
15 /***********
16  * Classes *
17  ***********/
18
19 class XBT_PRIVATE DiskS19Model;
20 class XBT_PRIVATE DiskS19;
21 class XBT_PRIVATE DiskS19Action;
22
23 /*********
24  * Model *
25  *********/
26
27 class DiskS19Model : public DiskModel {
28 public:
29   using DiskModel::DiskModel;
30   DiskImpl* create_disk(const std::string& name, double read_bandwidth, double write_bandwidth) override;
31
32   void update_actions_state(double now, double delta) override;
33 };
34
35 /************
36  * Resource *
37  ************/
38
39 class DiskS19 : public DiskImpl {
40 public:
41   using DiskImpl::DiskImpl;
42   void set_read_bandwidth(double value) override;
43   void set_write_bandwidth(double value) override;
44   void set_readwrite_bandwidth(double value) override;
45   void apply_event(kernel::profile::Event* triggered, double value) override;
46   DiskAction* io_start(sg_size_t size, s4u::Io::OpType type) override;
47 };
48
49 /**********
50  * Action *
51  **********/
52
53 class DiskS19Action : public DiskAction {
54 public:
55   DiskS19Action(Model* model, double cost, bool failed);
56   void update_remains_lazy(double now) override;
57 };
58
59 } // namespace simgrid::kernel::resource
60 #endif /* DISK_S19_HPP_ */