Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
move ugly dict closer to the C APIs
[simgrid.git] / src / s4u / s4u_storage.cpp
index 694466c..58ad8f4 100644 (file)
@@ -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::unordered_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()