-StorageN11::StorageN11(StorageModel* model, const char* name, lmm_system_t maxminSystem, double bread, double bwrite,
- double bconnection, const char* type_id, char* content_name, const char* content_type,
- sg_size_t size, char* attach)
- : Storage(model, name, maxminSystem, bread, bwrite, bconnection, type_id, content_name, content_type, size, attach)
-{
- XBT_DEBUG("Create resource with Bconnection '%f' Bread '%f' Bwrite '%f' and Size '%llu'", bconnection, bread, bwrite, size);
-}
-
-StorageAction *StorageN11::open(const char* mount, const char* path)
-{
- XBT_DEBUG("\tOpen file '%s'",path);
-
- sg_size_t size;
- sg_size_t* psize = nullptr;
- // if file does not exist create an empty file
- if (content_->find(path) != content_->end())
- size = *(content_->at(path));
- else {
- psize = new sg_size_t;
- size = 0;
- *psize = size;
- content_->insert({path, psize});
- XBT_DEBUG("File '%s' was not found, file created.",path);
- }
- surf_file_t file = xbt_new0(s_surf_file_t,1);
- file->name = xbt_strdup(path);
- file->size = size;
- file->mount = xbt_strdup(mount);
- file->current_position = 0;
-
- StorageAction* action = new StorageN11Action(model(), 0, isOff(), this, OPEN);
- action->file_ = file;
-
- return action;
-}
-
-StorageAction *StorageN11::close(surf_file_t fd)
+StorageN11::StorageN11(StorageModel* model, std::string name, lmm_system_t maxminSystem, double bread, double bwrite,
+ std::string type_id, std::string content_name, sg_size_t size, std::string attach)
+ : StorageImpl(model, name, maxminSystem, bread, bwrite, type_id, content_name, size, attach)