Logo AND Algorithmique Numérique Distribuée

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