Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Restructure surf++ storage
[simgrid.git] / src / surf / storage_n11.hpp
1 #include "storage_interface.hpp"
2
3 #ifndef STORAGE_N11_HPP_
4 #define STORAGE_N11_HPP_
5
6 /***********
7  * Classes *
8  ***********/
9
10 class StorageN11Model;
11 typedef StorageN11Model *StorageN11ModelPtr;
12
13 class StorageN11;
14 typedef StorageN11 *StorageN11Ptr;
15
16 class StorageN11Lmm;
17 typedef StorageN11Lmm *StorageN11LmmPtr;
18
19 class StorageN11Action;
20 typedef StorageN11Action *StorageN11ActionPtr;
21
22 class StorageN11ActionLmm;
23 typedef StorageN11ActionLmm *StorageN11ActionLmmPtr;
24
25
26 /*********
27  * Model *
28  *********/
29
30 class StorageN11Model : public StorageModel {
31 public:
32   StorageN11Model();
33   ~StorageN11Model();
34   StoragePtr createResource(const char* id, const char* type_id,
35                    const char* content_name, const char* content_type, xbt_dict_t properties);
36   double shareResources(double now);
37   void updateActionsState(double now, double delta);
38
39   xbt_dynar_t p_storageList;
40 };
41
42 /************
43  * Resource *
44  ************/
45
46 class StorageN11Lmm : public StorageLmm {
47 public:
48   StorageN11Lmm(StorageModelPtr model, const char* name, xbt_dict_t properties,
49                      lmm_system_t maxminSystem, double bread, double bwrite, double bconnection,
50                      const char* type_id, char *content_name, char *content_type, sg_size_t size);
51
52   StorageActionPtr open(const char* mount, const char* path);
53   StorageActionPtr close(surf_file_t fd);
54   StorageActionPtr ls(const char *path);
55   xbt_dict_t getContent();
56   sg_size_t getSize();
57   StorageActionPtr read(surf_file_t fd, sg_size_t size);//FIXME:why we have a useless param ptr ??
58   StorageActionPtr write(surf_file_t fd, sg_size_t size);//FIXME:why we have a useless param ptr ??
59   void rename(const char *src, const char *dest);
60
61   lmm_constraint_t p_constraintWrite;    /* Constraint for maximum write bandwidth*/
62   lmm_constraint_t p_constraintRead;     /* Constraint for maximum write bandwidth*/
63 };
64
65 /**********
66  * Action *
67  **********/
68
69 class StorageN11ActionLmm : public StorageActionLmm {
70 public:
71         StorageN11ActionLmm() {}; //FIXME:REMOVE
72   StorageN11ActionLmm(ModelPtr model, double cost, bool failed, StorageLmmPtr storage, e_surf_action_storage_type_t type);
73   void suspend();
74   int unref();
75   void cancel();
76   //FIXME:??void recycle();
77   void resume();
78   bool isSuspended();
79   void setMaxDuration(double duration);
80   void setPriority(double priority);
81
82 };
83
84 #endif /* STORAGE_N11_HPP_ */