Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix process_killall. Closes #186.
[simgrid.git] / src / s4u / s4u_storage.cpp
index 694466c..092afea 100644 (file)
@@ -16,13 +16,13 @@ std::map<std::string, Storage*>* allStorages()
 {
   std::unordered_map<std::string, surf::StorageImpl*>* map = surf::StorageImpl::storagesMap();
   std::map<std::string, Storage*>* res                     = new std::map<std::string, Storage*>;
-  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)
@@ -57,22 +57,22 @@ sg_size_t Storage::getSizeUsed()
 
 sg_size_t Storage::getSize()
 {
-  return pimpl_->size_;
+  return pimpl_->getSize();
 }
 
-xbt_dict_t Storage::getProperties()
+std::map<std::string, std::string>* Storage::getProperties()
 {
   return simgrid::simix::kernelImmediate([this] { return pimpl_->getProperties(); });
 }
 
 const char* Storage::getProperty(const char* key)
 {
-  return static_cast<const char*>(xbt_dict_get_or_null(this->getProperties(), key));
+  return this->pimpl_->getProperty(key);
 }
 
-void Storage::setProperty(const char* key, char* value)
+void Storage::setProperty(const char* key, const char* value)
 {
-  xbt_dict_set(this->getProperties(), key, value, nullptr);
+  simgrid::simix::kernelImmediate([this, key, value] { this->pimpl_->setProperty(key, value); });
 }
 
 std::map<std::string, sg_size_t>* Storage::getContent()