Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
All of the examples use now the StringHelp class to simplify the string manipulation.
[simgrid.git] / examples / cxx / autoDestination / Forwarder.cxx
index 24e2372..7953686 100644 (file)
@@ -5,15 +5,13 @@
 #include <Host.hpp>\r
 #include <HostNotFoundException.hpp>\r
 \r
-#include <iostream>\r
-using namespace std;\r
+#include <Msg.hpp>\r
 \r
 MSG_IMPLEMENT_DYNAMIC(Forwarder, Process);\r
 \r
-\r
 int Forwarder::main(int argc, char** argv)\r
 {\r
-       cout << "Hello I'm " << getName() << " on " << getHost().getName() << "!" << endl;\r
+       info("Hello");\r
        \r
        int aliasCount = argc;\r
        \r
@@ -29,7 +27,7 @@ int Forwarder::main(int argc, char** argv)
        \r
                if(taskReceived->isInstanceOf("FinalizeTask")) \r
                {\r
-                       cout <<"[" << getName() << ":" << getHost().getName() << "] " << "All tasks have been dispatched. Let's tell everybody the computation is over." << endl;\r
+                       info("All tasks have been dispatched. Let's tell everybody the computation is over.");\r
        \r
                        for (int i = 0; i < aliasCount; i++) \r
                        {\r
@@ -44,9 +42,9 @@ int Forwarder::main(int argc, char** argv)
        \r
                basicTask = reinterpret_cast<BasicTask*>(taskReceived);\r
        \r
-               cout <<"[" << getName() << ":" << getHost().getName() << "] " << "Received \"" << basicTask->getName() << "\" " << endl;\r
+               info(TEXT_("Received \"") + TEXT_(basicTask->getName()) + TEXT_("\" "));\r
        \r
-               cout <<"[" << getName() << ":" << getHost().getName() << "] " << "Sending \"" << basicTask->getName() << "\" to \"" << argv[taskCount % aliasCount] << "\"" << endl;\r
+               info(TEXT_("Sending \"") + TEXT_(basicTask->getName()) + TEXT_("\" to \"") + TEXT_(argv[taskCount % aliasCount]));\r
        \r
                basicTask->send(argv[taskCount % aliasCount]);\r
        \r
@@ -54,7 +52,7 @@ int Forwarder::main(int argc, char** argv)
        }\r
        \r
        \r
-       cout <<"[" << getName() << ":" << getHost().getName() << "] " << "I'm done. See you!" << endl;\r
+       info("I'm done. See you!");\r
 \r
        delete this;\r
        \r