~ubuntu-branches/ubuntu/quantal/simgrid/quantal

« back to all changes in this revision

Viewing changes to examples/cxx/suspend/DreamMaster.cxx

  • Committer: Package Import Robot
  • Author(s): Lucas Nussbaum, Martin Quinson, Lucas Nussbaum
  • Date: 2012-06-09 16:24:44 UTC
  • mfrom: (10.1.4 sid)
  • Revision ID: package-import@ubuntu.com-20120609162444-xook34f3d6qy5ixj
Tags: 3.7.1-1
[ Martin Quinson ]
* debian/copyright: update FSF address (thanks lintian for noticing)

[ Lucas Nussbaum ]
* New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
}