Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a class of exception for file not found and Msg files containing the declarations...
[simgrid.git] / src / cxx / Msg.cxx
1 \r
2 /*\r
3  * Msg.cxx\r
4  *\r
5  * Copyright 2006,2007 Martin Quinson, Malek Cherier           \r
6  * All right reserved. \r
7  *\r
8  * This program is free software; you can redistribute \r
9  * it and/or modify it under the terms of the license \r
10  *(GNU LGPL) which comes with this package. \r
11  *\r
12  */\r
13  \r
14  /* Msg functions implementation.\r
15   */  \r
16 #include <Msg.hpp>\r
17 \r
18 namespace SimGrid\r
19 {\r
20         namespace Msg\r
21         {\r
22                 \r
23                 void init(int argc, char** argv)\r
24                 {\r
25                         MSG_global_init(&argc,argv);\r
26                         MSG_set_channel_number(10); // FIXME: this should not be fixed statically \r
27                 }       \r
28                 \r
29                 void finalize(void)\r
30                 throw (MsgException)\r
31                 {\r
32                         if(MSG_OK != MSG_clean())\r
33                                 throw MsgException("MSG_clean() failed");\r
34                 }\r
35                 \r
36                 void info(const char* s)\r
37                 {\r
38                          INFO1("%s",s);\r
39                 }\r
40 \r
41         } // namespace Msg\r
42 \r
43 } // namespace SimGrid