11 typedef StorageModel *StorageModelPtr;
14 typedef Storage *StoragePtr;
16 class StorageActionLmm;
17 typedef StorageActionLmm *StorageActionLmmPtr;
22 class StorageModel : Model {
26 StoragePtr createResource(const char* id, const char* model, const char* type_id, const char* content_name);
27 double shareResources(double now);
28 void updateActionsState(double now, double delta);
30 xbt_dict_t parseContent(char *filename, size_t *used_size);
37 class Storage : public ResourceLmm {
39 Storage(StorageModelPtr model, const char* name, xbt_dict_t properties);
42 void updateState(tmgr_trace_event_t event_type, double value, double date);
44 lmm_constraint_t p_constraintWrite; /* Constraint for maximum write bandwidth*/
45 lmm_constraint_t p_constraintRead; /* Constraint for maximum write bandwidth*/
46 xbt_dict_t p_content; /* char * -> s_surf_file_t */
48 StorageActionLmmPtr open(const char* mount, const char* path);
49 StorageActionLmmPtr close(surf_file_t fd);
50 StorageActionLmmPtr unlink(surf_file_t fd);
51 StorageActionLmmPtr ls(const char *path);
52 size_t getSize(surf_file_t fd);
53 StorageActionLmmPtr read(void* ptr, size_t size, surf_file_t fd);//FIXME:why we have a useless param ptr ??
54 StorageActionLmmPtr write(const void* ptr, size_t size, surf_file_t fd);//FIXME:why we have a useless param ptr ??
58 xbt_dynar_t p_writeActions;
66 READ=0, WRITE, STAT, OPEN, CLOSE, LS
67 } e_surf_action_storage_type_t;
69 class StorageActionLmm : public ActionLmm {
72 StorageActionLmm(ModelPtr model, double cost, bool failed, StoragePtr storage, e_surf_action_storage_type_t type);
76 //FIXME:??void recycle();
80 void setMaxDuration(double duration);
81 void setPriority(double priority);
83 e_surf_action_storage_type_t m_type;
90 typedef struct s_storage_type {
94 xbt_dict_t properties;
96 } s_storage_type_t, *storage_type_t;
98 typedef struct s_mount {
101 } s_mount_t, *mount_t;
103 typedef struct surf_file {
110 #endif /* STORAGE_HPP_ */