X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3e42c9c678d7e69776850a7e168d160f122d24e1..9f6aa57a6e1eea25b6dabbe7f87717a6ca0f4523:/src/surf/StorageImpl.cpp diff --git a/src/surf/StorageImpl.cpp b/src/surf/StorageImpl.cpp index b162a6e2e9..cc888ddd19 100644 --- a/src/surf/StorageImpl.cpp +++ b/src/surf/StorageImpl.cpp @@ -6,7 +6,8 @@ #include "StorageImpl.hpp" -#include "surf_private.h" +#include "surf_private.hpp" +#include #include #include #include @@ -32,7 +33,7 @@ simgrid::xbt::signal storage std::unordered_map* StorageImpl::storages = new std::unordered_map(); -StorageImpl* StorageImpl::byName(const char* name) +StorageImpl* StorageImpl::byName(std::string name) { if (storages->find(name) == storages->end()) return nullptr; @@ -60,14 +61,14 @@ StorageModel::~StorageModel() StorageImpl::StorageImpl(Model* 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) - : Resource(model, name.c_str(), lmm_constraint_new(maxminSystem, this, MAX(bread, bwrite))) + : Resource(model, name.c_str(), lmm_constraint_new(maxminSystem, this, std::max(bread, bwrite))) , piface_(this) , typeId_(type_id) , size_(size) , attach_(attach) { content_ = parseContent(content_name); - turnOn(); + StorageImpl::turnOn(); XBT_DEBUG("Create resource with Bread '%f' Bwrite '%f' and Size '%llu'", bread, bwrite, size); constraintRead_ = lmm_constraint_new(maxminSystem, this, bread); constraintWrite_ = lmm_constraint_new(maxminSystem, this, bwrite); @@ -89,7 +90,7 @@ std::map* StorageImpl::parseContent(std::string filename std::map* parse_content = new std::map(); - std::ifstream* fs = surf_ifsopen(filename.c_str()); + std::ifstream* fs = surf_ifsopen(filename); std::string line; std::vector tokens;