Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix a bug
[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 StorageN11;
17 typedef StorageN11 *StorageN11Ptr;
18
19 class StorageN11Action;
20 typedef StorageN11Action *StorageN11ActionPtr;
21
22 class StorageN11Action;
23 typedef StorageN11Action *StorageN11ActionPtr;
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
40 /************
41  * Resource *
42  ************/
43
44 class StorageN11 : public Storage {
45 public:
46   StorageN11(StorageModelPtr model, const char* name, xbt_dict_t properties,
47                      lmm_system_t maxminSystem, double bread, double bwrite, double bconnection,
48                      const char* type_id, char *content_name, char *content_type, sg_size_t size);
49
50   StorageActionPtr open(const char* mount, const char* path);
51   StorageActionPtr close(surf_file_t fd);
52   StorageActionPtr ls(const char *path);
53   xbt_dict_t getContent();
54   sg_size_t getSize();
55   StorageActionPtr read(surf_file_t fd, sg_size_t size);//FIXME:why we have a useless param ptr ??
56   StorageActionPtr write(surf_file_t fd, sg_size_t size);//FIXME:why we have a useless param ptr ??
57   void rename(const char *src, const char *dest);
58
59   lmm_constraint_t p_constraintWrite;    /* Constraint for maximum write bandwidth*/
60   lmm_constraint_t p_constraintRead;     /* Constraint for maximum write bandwidth*/
61 };
62
63 /**********
64  * Action *
65  **********/
66
67 class StorageN11Action : public StorageAction {
68 public:
69         StorageN11Action() {}; //FIXME:REMOVE
70   StorageN11Action(ModelPtr model, double cost, bool failed, StoragePtr storage, e_surf_action_storage_type_t type);
71   void suspend();
72   int unref();
73   void cancel();
74   //FIXME:??void recycle();
75   void resume();
76   bool isSuspended();
77   void setMaxDuration(double duration);
78   void setPriority(double priority);
79
80 };
81
82 #endif /* STORAGE_N11_HPP_ */