Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Cleanup work to make is_race_reversible() a method of Transition
[simgrid.git] / examples / cpp / actor-exiting / s4u-actor-exiting.cpp
index 9693523f735de95921c39e35469f72d52b0bb43b..2b6a3866f8269b63365d01578d3468241659bd9c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017-2021. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2017-2023. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -77,16 +77,16 @@ int main(int argc, char* argv[])
   e.load_platform(argv[1]); /* - Load the platform description */
 
   /* Register a callback in the Actor::on_termination signal. It will be called for every terminated actors */
-  sg4::Actor::on_termination.connect(
+  sg4::Actor::on_termination_cb(
       [](sg4::Actor const& actor) { XBT_INFO("Actor %s terminates now", actor.get_cname()); });
   /* Register a callback in the Actor::on_destruction signal. It will be called for every destructed actors */
-  sg4::Actor::on_destruction.connect(
+  sg4::Actor::on_destruction_cb(
       [](sg4::Actor const& actor) { XBT_INFO("Actor %s gets destroyed now", actor.get_cname()); });
 
   /* Create some actors */
-  sg4::Actor::create("A", sg4::Host::by_name("Tremblay"), actor_a);
-  sg4::Actor::create("B", sg4::Host::by_name("Fafard"), actor_b);
-  sg4::Actor::create("C", sg4::Host::by_name("Ginette"), actor_c);
+  sg4::Actor::create("A", e.host_by_name("Tremblay"), actor_a);
+  sg4::Actor::create("B", e.host_by_name("Fafard"), actor_b);
+  sg4::Actor::create("C", e.host_by_name("Ginette"), actor_c);
 
   e.run(); /* - Run the simulation */