Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Travis: actually get the packages I just made available
[simgrid.git] / src / surf / storage_n11.hpp
1 /* Copyright (c) 2013-2018. 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   StorageImpl* createStorage(std::string id, std::string type_id, std::string content_name,
31                              std::string attach) override;
32   double next_occuring_event(double now) override;
33   void update_actions_state(double now, double delta) override;
34 };
35
36 /************
37  * Resource *
38  ************/
39
40 class StorageN11 : public StorageImpl {
41 public:
42   StorageN11(StorageModel* model, std::string name, kernel::lmm::System* maxminSystem, double bread, double bwrite,
43              std::string type_id, std::string content_name, sg_size_t size, std::string attach);
44   virtual ~StorageN11() = default;
45   StorageAction* read(sg_size_t size);
46   StorageAction* write(sg_size_t size);
47 };
48
49 /**********
50  * Action *
51  **********/
52
53 class StorageN11Action : public StorageAction {
54 public:
55   StorageN11Action(kernel::resource::Model* model, double cost, bool failed, StorageImpl* storage,
56                    e_surf_action_storage_type_t type);
57   void suspend() override;
58   void cancel() override;
59   void resume() override;
60   void set_max_duration(double duration) override;
61   void set_priority(double priority) override;
62   void update_remains_lazy(double now) override;
63 };
64
65 }
66 }
67
68 #endif /* STORAGE_N11_HPP_ */