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 / suspend / DreamMaster.cxx
index 0bf21ec..62ed58f 100644 (file)
@@ -4,17 +4,17 @@
 #include <HostNotFoundException.hpp>\r
 #include <Msg.hpp>\r
 \r
-#include <iostream>\r
-using namespace std;\r
+#include <Msg.hpp>\r
+\r
 \r
 MSG_IMPLEMENT_DYNAMIC(DreamMaster, Process);\r
 \r
 int DreamMaster::main(int argc, char** argv)\r
 {\r
        \r
-       cout <<"[" << getName() << ":" << getHost().getName() << "] " << "Hello I'm " << getName() << " on " << getHost().getName() << "!" << endl;\r
+       info("Hello");\r
        \r
-       cout <<"[" << getName() << ":" << getHost().getName() << "] " << "Let's create a lazy guy.";\r
+       info("Let's create a lazy guy.");\r
        \r
 \r
        LazyGuy* lazy;\r
@@ -23,15 +23,15 @@ int DreamMaster::main(int argc, char** argv)
        {\r
                Host currentHost = Host::currentHost();\r
        \r
-               cout <<"[" << getName() << ":" << getHost().getName() << "] " << "Current host  name : " << currentHost.getName() << endl;\r
+               info(TEXT_("Current host  name : ") + TEXT_(currentHost.getName()));\r
        \r
                lazy = new LazyGuy(currentHost,"LazyGuy");\r
        \r
-               cout <<"[" << getName() << ":" << getHost().getName() << "] " << "Let's wait a little bit..." << endl;\r
+               info("Let's wait a little bit...");\r
        \r
                Process::sleep(10.0);\r
        \r
-               cout <<"[" << getName() << ":" << getHost().getName() << "] " << "Let's wake the lazy guy up! >:) " << endl;\r
+               info("Let's wake the lazy guy up! >:) ");\r
        \r
                lazy->resume();\r
        \r
@@ -39,13 +39,13 @@ int DreamMaster::main(int argc, char** argv)
        }\r
        catch(HostNotFoundException e)\r
        {\r
-               cerr << e.toString() <<". Stopping Now!" << endl;\r
+               error(TEXT_(e.toString()) + TEXT_(". Stopping Now!"));\r
                exit(1);\r
        }\r
        \r
        //lazy->migrate(currentHost);\r
        \r
-       cout <<"[" << getName() << ":" << getHost().getName() << "] " << "OK, goodbye now." << endl;\r
+       info("OK, goodbye now.");\r
 \r
        delete this;\r
 \r