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
diff --git a/src/cxx/Msg.cxx b/src/cxx/Msg.cxx
new file mode 100644 (file)
index 0000000..94c7e81
--- /dev/null
@@ -0,0 +1,43 @@
+\r
+/*\r
+ * Msg.cxx\r
+ *\r
+ * Copyright 2006,2007 Martin Quinson, Malek Cherier           \r
+ * All right reserved. \r
+ *\r
+ * This program is free software; you can redistribute \r
+ * it and/or modify it under the terms of the license \r
+ *(GNU LGPL) which comes with this package. \r
+ *\r
+ */\r
\r
+ /* Msg functions implementation.\r
+  */  \r
+#include <Msg.hpp>\r
+\r
+namespace SimGrid\r
+{\r
+       namespace Msg\r
+       {\r
+               \r
+               void init(int argc, char** argv)\r
+               {\r
+                       MSG_global_init(&argc,argv);\r
+                       MSG_set_channel_number(10); // FIXME: this should not be fixed statically \r
+               }       \r
+               \r
+               void finalize(void)\r
+               throw (MsgException)\r
+               {\r
+                       if(MSG_OK != MSG_clean())\r
+                               throw MsgException("MSG_clean() failed");\r
+               }\r
+               \r
+               void info(const char* s)\r
+               {\r
+                        INFO1("%s",s);\r
+               }\r
+\r
+       } // namespace Msg\r
+\r
+} // namespace SimGrid
\ No newline at end of file