X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/96cedde3cdbc0b8ffc3f096a1b65d021b0226f99..97a1cccb092b83949ea84b98625aa8754c397364:/examples/s4u/actor-create/s4u-actor-create.cpp diff --git a/examples/s4u/actor-create/s4u-actor-create.cpp b/examples/s4u/actor-create/s4u-actor-create.cpp index c8eb08896b..b587f42136 100644 --- a/examples/s4u/actor-create/s4u-actor-create.cpp +++ b/examples/s4u/actor-create/s4u-actor-create.cpp @@ -27,9 +27,9 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_actor_create, "The logging channel used in this * * Later, this actor class is instantiated within the simulation. */ -static void receiver(std::string mailbox_name) +static void receiver(const std::string& mailbox_name) { - simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::by_name(mailbox_name); + simgrid::s4u::Mailbox* mailbox = simgrid::s4u::Mailbox::by_name(mailbox_name); XBT_INFO("Hello s4u, I'm ready to get any message you'd want on %s", mailbox->get_cname()); @@ -47,8 +47,8 @@ static void receiver(std::string mailbox_name) static int forwarder(int argc, char** argv) { xbt_assert(argc >= 3, "Actor forwarder requires 2 parameters, but got only %d", argc - 1); - simgrid::s4u::MailboxPtr in = simgrid::s4u::Mailbox::by_name(argv[1]); - simgrid::s4u::MailboxPtr out = simgrid::s4u::Mailbox::by_name(argv[2]); + simgrid::s4u::Mailbox* in = simgrid::s4u::Mailbox::by_name(argv[1]); + simgrid::s4u::Mailbox* out = simgrid::s4u::Mailbox::by_name(argv[2]); std::string* msg = static_cast(in->get()); XBT_INFO("Forward '%s'.", msg->c_str()); out->put(msg, msg->size()); @@ -65,7 +65,7 @@ public: std::string mbox = "mb42"; std::string msg = "GaBuZoMeu"; explicit Sender() = default; /* Sending the default message */ - explicit Sender(std::string arg) : msg(arg) { /* Sending the specified message */} + explicit Sender(const std::string& arg) : msg(arg) { /* Sending the specified message */} explicit Sender(std::vector args) { /* This constructor is used when we start the actor from the deployment file */ @@ -79,7 +79,7 @@ public: void operator()() /* This is the main code of the actor */ { XBT_INFO("Hello s4u, I have something to send"); - simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::by_name(mbox); + simgrid::s4u::Mailbox* mailbox = simgrid::s4u::Mailbox::by_name(mbox); mailbox->put(new std::string(msg), msg.size()); XBT_INFO("I'm done. See you.");