*
* The first step is to declare the code of your actors (what they do exactly does not matter to this example) and then
* you ask SimGrid to start your actors. There is three ways of doing so:
- * - Directly, by instantiating your actor as paramter to Actor::create();
+ * - Directly, by instantiating your actor as paramter to Actor::create()
* - By first registering your actors before instantiating it;
* - Through the deployment file.
*
class Sender {
public:
std::string msg = "GaBuZoMeu";
- explicit Sender(){
- /* Constructor used when no parameter is passed to the actor */
- };
+ explicit Sender() = default;
explicit Sender(std::vector<std::string> args)
{
/* This constructor is used when we pass parameters to the actor */
char* msg1 = static_cast<char*>(simgrid::s4u::this_actor::recv(mailbox));
char* msg2 = static_cast<char*>(simgrid::s4u::this_actor::recv(mailbox));
XBT_INFO("I received '%s' and '%s'", msg1, msg2);
+ xbt_free(msg1);
+ xbt_free(msg2);
XBT_INFO("I'm done. See you.");
}
};
e->run();
/* Once the simulation is done, the program is ended */
+ e->shutdown();
return 0;
}