Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
A string utility class and a new Exception (used to throw out of band exception)
[simgrid.git] / src / cxx / Msg.hpp
1 /*\r
2  * Msg.hpp\r
3  *\r
4  * This file contains the declaration of the wrapper class of the native MSG task type.\r
5  *\r
6  * Copyright 2006,2007 Martin Quinson, Malek Cherier           \r
7  * All right reserved. \r
8  *\r
9  * This program is free software; you can redistribute \r
10  * it and/or modify it under the terms of the license \r
11  *(GNU LGPL) which comes with this package. \r
12  *\r
13  */  \r
14  \r
15 #ifndef MSG_HPP\r
16 #define MSG_HPP\r
17 \r
18 // Compilation C++ recquise\r
19 #ifndef __cplusplus\r
20         #error Msg.hpp requires C++ compilation (use a .cxx suffix)\r
21 #endif\r
22 \r
23 #include <MsgException.hpp>\r
24 #include <InvalidArgumentException.hpp>\r
25 #include <LogicException.hpp>\r
26 \r
27 #include <StringHelper.hpp>\r
28 \r
29 \r
30 namespace SimGrid\r
31 {\r
32         namespace Msg\r
33         {\r
34                 class MsgException;\r
35                 class InvalidArgumentException;\r
36                 class LogicException;\r
37                 \r
38                 /*! \brief init() - Initialize MSG (This function must be called at the begining of each simulation).\r
39                  *\r
40                  * \param argv                  A list of arguments.\r
41                  * \param argc                  The number of arguments of the list.\r
42                  */\r
43                 SIMGRIDX_EXPORT void init(int argc, char** argv);\r
44                 \r
45                 /*! \brief finalize() - Finalize MSG (This function must be called at the end of each simulation).\r
46                  *\r
47                  * \exception                   If this function fails, it throws a exception describing the cause of the failure.\r
48                  */\r
49                 SIMGRIDX_EXPORT void finalize(void)\r
50                 throw (MsgException);\r
51                 \r
52                 /*! \brief info() - Display information (using xbt log format).\r
53                  *\r
54                  * \param s                             The information to display.\r
55                  */\r
56                 SIMGRIDX_EXPORT void info(const StringHelper& s);\r
57 \r
58                 SIMGRIDX_EXPORT void info(const char* s);\r
59 \r
60                 SIMGRIDX_EXPORT void error(const StringHelper& s);\r
61 \r
62                 SIMGRIDX_EXPORT void error(const char* s);\r
63 \r
64 \r
65                 /*! \brief getClock() -  Retrieve the simulation time\r
66                  *\r
67                  * \return                              The current simulation time.\r
68                  */\r
69                 SIMGRIDX_EXPORT double getClock(void);\r
70 \r
71 \r
72                 SIMGRIDX_EXPORT void setMaxChannelNumber(int number)\r
73                 throw(InvalidArgumentException, LogicException);\r
74 \r
75                 SIMGRIDX_EXPORT int getMaxChannelNumber(void);\r
76                 \r
77         } // namespace Msg\r
78 } // namespace SimGrid\r
79 \r
80 #endif // !MSG_HPP\r