Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
A simcall seems superfluous here (+ constify).
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 9 Apr 2019 15:29:25 +0000 (17:29 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 9 Apr 2019 16:11:08 +0000 (18:11 +0200)
include/simgrid/s4u/Actor.hpp
src/s4u/s4u_Actor.cpp
src/surf/PropertyHolder.cpp
src/surf/PropertyHolder.hpp

index a089020..7bde9ca 100644 (file)
@@ -290,8 +290,8 @@ public:
 
   /** Retrieve the property value (or nullptr if not set) */
   std::unordered_map<std::string, std::string>*
-  get_properties(); // FIXME: do not export the map, but only the keys or something
-  const char* get_property(const std::string& key);
+  get_properties() const; // FIXME: do not export the map, but only the keys or something
+  const char* get_property(const std::string& key) const;
   void set_property(const std::string& key, const std::string& value);
 
 #ifndef DOXYGEN
index 9170931..ef457c6 100644 (file)
@@ -232,15 +232,15 @@ void Actor::kill_all()
   simix::simcall([self] { self->kill_all(); });
 }
 
-std::unordered_map<std::string, std::string>* Actor::get_properties()
+std::unordered_map<std::string, std::string>* Actor::get_properties() const
 {
-  return simix::simcall([this] { return this->pimpl_->get_properties(); });
+  return pimpl_->get_properties();
 }
 
 /** Retrieve the property value (or nullptr if not set) */
-const char* Actor::get_property(const std::string& key)
+const char* Actor::get_property(const std::string& key) const
 {
-  return simix::simcall([this, &key] { return pimpl_->get_property(key); });
+  return pimpl_->get_property(key);
 }
 
 void Actor::set_property(const std::string& key, const std::string& value)
index 39be42b..d1378fb 100644 (file)
@@ -13,7 +13,7 @@ PropertyHolder::~PropertyHolder() {
 }
 
 /** @brief Return the property associated to the provided key (or nullptr if not existing) */
-const char* PropertyHolder::get_property(const std::string& key)
+const char* PropertyHolder::get_property(const std::string& key) const
 {
   if (properties_ == nullptr)
     return nullptr;
index 95d7987..d2b5631 100644 (file)
@@ -23,7 +23,7 @@ public:
   PropertyHolder& operator=(const PropertyHolder&) = delete;
   ~PropertyHolder();
 
-  const char* get_property(const std::string& key);
+  const char* get_property(const std::string& key) const;
   void set_property(const std::string& id, const std::string& value);
 
   /* FIXME: This should not be exposed, as users may do bad things with the map they got (it's not a copy).