Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Pass std::string parameters by reference too.
[simgrid.git] / src / surf / storage_n11.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 #include <xbt/base.h>
7
8 #include "StorageImpl.hpp"
9
10 #ifndef STORAGE_N11_HPP_
11 #define STORAGE_N11_HPP_
12
13 namespace simgrid {
14 namespace surf {
15
16 /***********
17  * Classes *
18  ***********/
19
20 class XBT_PRIVATE StorageN11Model;
21 class XBT_PRIVATE StorageN11;
22 class XBT_PRIVATE StorageN11Action;
23
24 /*********
25  * Model *
26  *********/
27
28 class StorageN11Model : public StorageModel {
29 public:
30   StorageN11Model();
31   StorageImpl* createStorage(const std::string& id, const std::string& type_id, const std::string& content_name,
32                              const std::string& attach) override;
33   double next_occuring_event(double now) override;
34   void update_actions_state(double now, double delta) override;
35 };
36
37 /************
38  * Resource *
39  ************/
40
41 class StorageN11 : public StorageImpl {
42 public:
43   StorageN11(StorageModel* model, const std::string& name, kernel::lmm::System* maxminSystem, double bread,
44              double bwrite, const std::string& type_id, const std::string& content_name, sg_size_t size,
45              const std::string& attach);
46   virtual ~StorageN11() = default;
47   StorageAction* io_start(sg_size_t size, s4u::Io::OpType type);
48   StorageAction* read(sg_size_t size);
49   StorageAction* write(sg_size_t size);
50 };
51
52 /**********
53  * Action *
54  **********/
55
56 class StorageN11Action : public StorageAction {
57 public:
58   StorageN11Action(kernel::resource::Model* model, double cost, bool failed, StorageImpl* storage,
59                    s4u::Io::OpType type);
60   void suspend() override;
61   void cancel() override;
62   void resume() override;
63   void set_max_duration(double duration) override;
64   void set_priority(double priority) override;
65   void update_remains_lazy(double now) override;
66 };
67
68 }
69 }
70
71 #endif /* STORAGE_N11_HPP_ */