Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge pull request #202 from Takishipp/clear_fct
[simgrid.git] / src / surf / storage_n11.hpp
1 /* Copyright (c) 2013-2015. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #include <xbt/base.h>
8
9 #include "FileImpl.hpp"
10 #include "StorageImpl.hpp"
11
12 #ifndef STORAGE_N11_HPP_
13 #define STORAGE_N11_HPP_
14
15 namespace simgrid {
16 namespace surf {
17
18 /***********
19  * Classes *
20  ***********/
21
22 class XBT_PRIVATE StorageN11Model;
23 class XBT_PRIVATE StorageN11;
24 class XBT_PRIVATE StorageN11Action;
25
26 /*********
27  * Model *
28  *********/
29
30 class StorageN11Model : public StorageModel {
31 public:
32   StorageImpl* createStorage(const char* id, const char* type_id, const char* content_name,
33                              const char* attach) override;
34   double nextOccuringEvent(double now) override;
35   void updateActionsState(double now, double delta) override;
36 };
37
38 /************
39  * Resource *
40  ************/
41
42 class StorageN11 : public StorageImpl {
43 public:
44   StorageN11(StorageModel* model, const char* name, lmm_system_t maxminSystem, double bread, double bwrite,
45              const char* type_id, char* content_name, sg_size_t size, char* attach);
46   virtual ~StorageN11() = default;
47   StorageAction* read(sg_size_t size);
48   StorageAction* write(sg_size_t size);
49 };
50
51 /**********
52  * Action *
53  **********/
54
55 class StorageN11Action : public StorageAction {
56 public:
57   StorageN11Action(Model* model, double cost, bool failed, StorageImpl* storage, e_surf_action_storage_type_t type);
58   void suspend();
59   int unref();
60   void cancel();
61   void resume();
62   bool isSuspended();
63   void setMaxDuration(double duration);
64   void setSharingWeight(double priority);
65 };
66
67 }
68 }
69
70 #endif /* STORAGE_N11_HPP_ */