Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of https://framagit.org/simgrid/simgrid into no_simix_global
[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 public:
45   using DiskImpl::DiskImpl;
46   void set_read_bandwidth(double value) override;
47   void set_write_bandwidth(double value) override;
48   void set_readwrite_bandwidth(double value) override;
49   void apply_event(kernel::profile::Event* triggered, double value) override;
50 };
51
52 /**********
53  * Action *
54  **********/
55
56 class DiskS19Action : public DiskAction {
57 public:
58   DiskS19Action(Model* model, double cost, bool failed);
59   void update_remains_lazy(double now) override;
60 };
61
62 } // namespace resource
63 } // namespace kernel
64 } // namespace simgrid
65 #endif /* DISK_S19_HPP_ */