X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/283236f8e2414d7c30d46e6d1aea0e8882699dd1..0c43de62fbe4bfc243d6512296e09207e80bcd54:/src/surf/storage.hpp diff --git a/src/surf/storage.hpp b/src/surf/storage.hpp index 28994812d0..91afd10f22 100644 --- a/src/surf/storage.hpp +++ b/src/surf/storage.hpp @@ -26,15 +26,15 @@ typedef StorageActionLmm *StorageActionLmmPtr; /********* * Model * *********/ -class StorageModel : Model { +class StorageModel : public Model { public: StorageModel(); ~StorageModel(); - StoragePtr createResource(const char* id, const char* model, const char* type_id, const char* content_name); + StoragePtr createResource(const char* id, const char* model, const char* type_id, + const char* content_name, const char* content_type, xbt_dict_t properties); double shareResources(double now); void updateActionsState(double now, double delta); - xbt_dict_t parseContent(char *filename, size_t *used_size); }; /************ @@ -48,18 +48,25 @@ public: bool isUsed(); void updateState(tmgr_trace_event_t event_type, double value, double date); - xbt_dict_t p_content; /* char * -> s_surf_file_t */ + xbt_dict_t p_content; + char* p_contentType; + sg_size_t m_size; + sg_size_t m_usedSize; + char * p_typeId; virtual StorageActionPtr open(const char* mount, const char* path)=0; virtual StorageActionPtr close(surf_file_t fd)=0; //virtual StorageActionPtr unlink(surf_file_t fd)=0; virtual StorageActionPtr ls(const char *path)=0; - //virtual size_t getSize(surf_file_t fd); - virtual StorageActionPtr read(void* ptr, size_t size, surf_file_t fd)=0;//FIXME:why we have a useless param ptr ?? - virtual StorageActionPtr write(const void* ptr, size_t size, surf_file_t fd)=0;//FIXME:why we have a useless param ptr ?? + virtual StorageActionPtr read(surf_file_t fd, sg_size_t size)=0; + virtual StorageActionPtr write(surf_file_t fd, sg_size_t size)=0; + virtual void rename(const char *src, const char *dest)=0; + + virtual xbt_dict_t getContent()=0; + virtual sg_size_t getSize()=0; + + xbt_dict_t parseContent(char *filename); - size_t m_size; - size_t m_usedSize; xbt_dynar_t p_writeActions; }; @@ -67,15 +74,17 @@ class StorageLmm : public ResourceLmm, public Storage { public: StorageLmm(StorageModelPtr model, const char* name, xbt_dict_t properties, lmm_system_t maxminSystem, double bread, double bwrite, double bconnection, - xbt_dict_t content, size_t size); + const char* type_id, char *content_name, char *content_type, size_t size); StorageActionPtr open(const char* mount, const char* path); StorageActionPtr close(surf_file_t fd); //StorageActionPtr unlink(surf_file_t fd); StorageActionPtr ls(const char *path); - //size_t getSize(surf_file_t fd); - StorageActionPtr read(void* ptr, size_t size, surf_file_t fd);//FIXME:why we have a useless param ptr ?? - StorageActionPtr write(const void* ptr, size_t size, surf_file_t fd);//FIXME:why we have a useless param ptr ?? + xbt_dict_t getContent(); + sg_size_t getSize(); + StorageActionPtr read(surf_file_t fd, sg_size_t size);//FIXME:why we have a useless param ptr ?? + StorageActionPtr write(surf_file_t fd, sg_size_t size);//FIXME:why we have a useless param ptr ?? + void rename(const char *src, const char *dest); lmm_constraint_t p_constraintWrite; /* Constraint for maximum write bandwidth*/ lmm_constraint_t p_constraintRead; /* Constraint for maximum write bandwidth*/ @@ -93,7 +102,8 @@ typedef enum { class StorageAction : virtual public Action { public: StorageAction(){}; - StorageAction(ModelPtr model, double cost, bool failed, StoragePtr storage, e_surf_action_storage_type_t type){}; + StorageAction(ModelPtr /*model*/, double /*cost*/, bool /*failed*/, StoragePtr storage, e_surf_action_storage_type_t type) + : m_type(type), p_storage(storage) {}; @@ -122,20 +132,21 @@ public: typedef struct s_storage_type { char *model; char *content; + char *content_type; char *type_id; xbt_dict_t properties; - size_t size; + sg_size_t size; } s_storage_type_t, *storage_type_t; typedef struct s_mount { - void *id; + void *storage; char *name; } s_mount_t, *mount_t; typedef struct surf_file { char *name; - char *storage; - size_t size; + char *mount; + sg_size_t size; } s_surf_file_t;