Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Smart pointer is not necessary for Actor::self.
[simgrid.git] / src / s4u / s4u_Actor.cpp
index 9170931..99d80a7 100644 (file)
@@ -31,13 +31,13 @@ xbt::signal<void(Actor const&)> s4u::Actor::on_migration_end;
 xbt::signal<void(Actor const&)> s4u::Actor::on_destruction;
 
 // ***** Actor creation *****
-ActorPtr Actor::self()
+Actor* Actor::self()
 {
   kernel::context::Context* self_context = kernel::context::Context::self();
   if (self_context == nullptr)
-    return ActorPtr();
+    return nullptr;
 
-  return self_context->get_actor()->iface();
+  return self_context->get_actor()->ciface();
 }
 ActorPtr Actor::init(const std::string& name, s4u::Host* host)
 {
@@ -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)