/** 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
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)
}
/** @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;
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).