Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
change consecutive to the renaming of the C++ wrappers
[simgrid.git] / examples / cxx / suspend / DreamMaster.cxx
1 #include "DreamMaster.hpp"
2 #include "LazyGuy.hpp"
3 #include <MsgHost.hpp>
4 #include <HostNotFoundException.hpp>
5 #include <Msg.hpp>
6
7 #include <Msg.hpp>
8
9
10 MSG_IMPLEMENT_DYNAMIC(DreamMaster, Process)
11
12 int DreamMaster::main(int argc, char** argv)
13 {
14         
15         info("Hello");
16         
17         info("Let's create a lazy guy.");
18         
19
20         LazyGuy* lazy;
21
22         try
23         {
24                 Host currentHost = Host::currentHost();
25         
26                 info(TEXT_("Current host  name : ") + TEXT_(currentHost.getName()));
27         
28                 lazy = new LazyGuy(currentHost,"LazyGuy");
29         
30                 info("Let's wait a little bit...");
31         
32                 Process::sleep(10.0);
33         
34                 info("Let's wake the lazy guy up! >:) ");
35         
36                 lazy->resume();
37         
38         
39         }
40         catch(HostNotFoundException e)
41         {
42                 error(TEXT_(e.toString()) + TEXT_(". Stopping Now!"));
43                 exit(1);
44         }
45         
46         //lazy->migrate(currentHost);
47         
48         info("OK, goodbye now.");
49
50         delete this;
51
52         return 0;
53         
54 }