Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Smart pointer is not necessary for Actor::self.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 17 Apr 2019 19:13:16 +0000 (21:13 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 17 Apr 2019 19:39:17 +0000 (21:39 +0200)
include/simgrid/s4u/Actor.hpp
src/s4u/s4u_Actor.cpp
src/smpi/smpi_replay_main.cpp

index 7bde9ca..1dc179f 100644 (file)
@@ -142,7 +142,7 @@ public:
 
   // ***** Actor creation *****
   /** Retrieve a reference to myself */
-  static ActorPtr self();
+  static Actor* self();
 
   /** Signal to others that a new actor has been created **/
   static xbt::signal<void(Actor&)> on_creation;
index ef457c6..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)
 {
index 72898c5..2404541 100644 (file)
@@ -6,7 +6,7 @@
 
 int main(int argc, char* argv[])
 {
-  if (simgrid::s4u::Actor::self().get() == nullptr) {
+  if (simgrid::s4u::Actor::self() == nullptr) {
     printf("smpireplaymain should not be called directly. Please use smpirun -replay instead.\n");
     return 1;
   }