X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0bfafcab47ae9cd7856bd8d129404c33079d6afe..2ef958bf49890e4ac8fbe179f1d339b923fb67a8:/examples/cpp/actor-exiting/s4u-actor-exiting.cpp diff --git a/examples/cpp/actor-exiting/s4u-actor-exiting.cpp b/examples/cpp/actor-exiting/s4u-actor-exiting.cpp index 9693523f73..2b6a3866f8 100644 --- a/examples/cpp/actor-exiting/s4u-actor-exiting.cpp +++ b/examples/cpp/actor-exiting/s4u-actor-exiting.cpp @@ -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 */