X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a4eb5efea24b01bda48fb4dc7c7600de78b4578b..22e6546d2c6f14864cc93c4ed1470d8e8c1e2d95:/src/s4u/s4u_storage.cpp diff --git a/src/s4u/s4u_storage.cpp b/src/s4u/s4u_storage.cpp index f746562730..c3066bd3a6 100644 --- a/src/s4u/s4u_storage.cpp +++ b/src/s4u/s4u_storage.cpp @@ -16,13 +16,13 @@ std::map* allStorages() { std::unordered_map* map = surf::StorageImpl::storagesMap(); std::map* res = new std::map; - for (auto s : *map) + for (auto const& s : *map) res->insert({s.first, &(s.second->piface_)}); // Convert each entry into its interface return res; } -Storage* Storage::byName(const char* name) +Storage* Storage::byName(std::string name) { surf::StorageImpl* res = surf::StorageImpl::byName(name); if (res == nullptr) @@ -30,9 +30,14 @@ Storage* Storage::byName(const char* name) return &res->piface_; } -const char* Storage::getName() +const std::string& Storage::getName() const { - return pimpl_->cname(); + return pimpl_->getName(); +} + +const char* Storage::getCname() const +{ + return pimpl_->getCname(); } const char* Storage::getType() @@ -60,7 +65,7 @@ sg_size_t Storage::getSize() return pimpl_->getSize(); } -xbt_dict_t Storage::getProperties() +std::map* Storage::getProperties() { return simgrid::simix::kernelImmediate([this] { return pimpl_->getProperties(); }); } @@ -70,7 +75,7 @@ const char* Storage::getProperty(const char* key) return this->pimpl_->getProperty(key); } -void Storage::setProperty(const char* key, char* value) +void Storage::setProperty(const char* key, const char* value) { simgrid::simix::kernelImmediate([this, key, value] { this->pimpl_->setProperty(key, value); }); }