X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/45fc9b393d412fb043fadf8e660fa6a137125f45..6fbbccdc1e85be059469b32886a28a26d4d7b0ce:/examples/cxx/suspend/DreamMaster.cxx diff --git a/examples/cxx/suspend/DreamMaster.cxx b/examples/cxx/suspend/DreamMaster.cxx index 0bf21ec012..a4e58b32a7 100644 --- a/examples/cxx/suspend/DreamMaster.cxx +++ b/examples/cxx/suspend/DreamMaster.cxx @@ -1,54 +1,54 @@ -#include "DreamMaster.hpp" -#include "LazyGuy.hpp" -#include -#include -#include - -#include -using namespace std; - -MSG_IMPLEMENT_DYNAMIC(DreamMaster, Process); - -int DreamMaster::main(int argc, char** argv) -{ - - cout <<"[" << getName() << ":" << getHost().getName() << "] " << "Hello I'm " << getName() << " on " << getHost().getName() << "!" << endl; - - cout <<"[" << getName() << ":" << getHost().getName() << "] " << "Let's create a lazy guy."; - - - LazyGuy* lazy; - - try - { - Host currentHost = Host::currentHost(); - - cout <<"[" << getName() << ":" << getHost().getName() << "] " << "Current host name : " << currentHost.getName() << endl; - - lazy = new LazyGuy(currentHost,"LazyGuy"); - - cout <<"[" << getName() << ":" << getHost().getName() << "] " << "Let's wait a little bit..." << endl; - - Process::sleep(10.0); - - cout <<"[" << getName() << ":" << getHost().getName() << "] " << "Let's wake the lazy guy up! >:) " << endl; - - lazy->resume(); - - - } - catch(HostNotFoundException e) - { - cerr << e.toString() <<". Stopping Now!" << endl; - exit(1); - } - - //lazy->migrate(currentHost); - - cout <<"[" << getName() << ":" << getHost().getName() << "] " << "OK, goodbye now." << endl; - - delete this; - - return 0; - -} \ No newline at end of file +#include "DreamMaster.hpp" +#include "LazyGuy.hpp" +#include +#include +#include + +#include + + +MSG_IMPLEMENT_DYNAMIC(DreamMaster, Process) + +int DreamMaster::main(int argc, char** argv) +{ + + info("Hello"); + + info("Let's create a lazy guy."); + + + LazyGuy* lazy; + + try + { + Host currentHost = Host::currentHost(); + + info(TEXT_("Current host name : ") + TEXT_(currentHost.getName())); + + lazy = new LazyGuy(currentHost,"LazyGuy"); + + info("Let's wait a little bit..."); + + Process::sleep(10.0); + + info("Let's wake the lazy guy up! >:) "); + + lazy->resume(); + + + } + catch(HostNotFoundException e) + { + error(TEXT_(e.toString()) + TEXT_(". Stopping Now!")); + exit(1); + } + + //lazy->migrate(currentHost); + + info("OK, goodbye now."); + + delete this; + + return 0; + +}