X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9cccb540315b9453bfc60e07d953ae81b44bd049..505d827ccafbb31eb15cfbd72bdc6079e50525e2:/examples/cpp/network-factors/s4u-network-factors.cpp diff --git a/examples/cpp/network-factors/s4u-network-factors.cpp b/examples/cpp/network-factors/s4u-network-factors.cpp index abeeab7e64..1ff67f6252 100644 --- a/examples/cpp/network-factors/s4u-network-factors.cpp +++ b/examples/cpp/network-factors/s4u-network-factors.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2022. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2010-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. */ @@ -183,7 +183,7 @@ public: } /* Create a communication representing the ongoing communication */ - auto mbox = sg4::Mailbox::by_name(host->get_name()); + auto* mbox = sg4::Mailbox::by_name(host->get_name()); auto* payload = new std::string(msg); mbox->put(payload, static_cast(size)); } @@ -192,7 +192,7 @@ public: XBT_INFO("Done dispatching all messages"); /* sending message to stop receivers */ for (const auto* host : hosts_) { - auto mbox = sg4::Mailbox::by_name(host->get_name()); + auto* mbox = sg4::Mailbox::by_name(host->get_name()); mbox->put(new std::string("finalize"), 0); } } @@ -203,7 +203,7 @@ class Receiver { public: void operator()() const { - auto mbox = sg4::Mailbox::by_name(sg4::this_actor::get_host()->get_name()); + auto* mbox = sg4::Mailbox::by_name(sg4::this_actor::get_host()->get_name()); // Receiving the message was all we were supposed to do for (bool cont = true; cont;) { auto received = mbox->get_unique(); @@ -235,10 +235,9 @@ int main(int argc, char* argv[]) sg4::Host* host = e.host_by_name("dahu-1.grid5000.fr"); sg4::Host* host_remote = e.host_by_name("dahu-10.grid5000.fr"); - sg4::Actor::create(std::string("receiver-local"), host, Receiver()); - sg4::Actor::create(std::string("receiver-remote"), host_remote, Receiver()); - sg4::Actor::create(std::string("sender") + std::string(host->get_name()), host, - Sender({host, host_remote}, crosstraffic)); + sg4::Actor::create("receiver-local", host, Receiver()); + sg4::Actor::create("receiver-remote", host_remote, Receiver()); + sg4::Actor::create("sender" + host->get_name(), host, Sender({host, host_remote}, crosstraffic)); /* runs the simulation */ e.run();