Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add comment and exception mechanism to the Host class.
[simgrid.git] / src / cxx / MsgException.hpp
1 /*\r
2  * MsgException.hpp\r
3  *\r
4  * Copyright 2006,2007 Martin Quinson, Malek Cherier           \r
5  * All right reserved. \r
6  *\r
7  * This program is free software; you can redistribute \r
8  * it and/or modify it under the terms of the license \r
9  *(GNU LGPL) which comes with this package. \r
10  *\r
11  */  \r
12  \r
13 #ifndef MSG_MSGEXCEPTION_HPP\r
14 #define MSG_MSGEXCEPTION_HPP\r
15 \r
16 #include "Exception.hpp"\r
17 \r
18 namespace SimGrid\r
19 {\r
20         namespace Msg\r
21         {\r
22                 \r
23                 class MsgException : public Exception\r
24                 {\r
25                         public:\r
26                         \r
27                         // Default constructor.\r
28                                 MsgException();\r
29                         \r
30                         // Copy constructor.\r
31                                 MsgException(const MsgException& rMsgException);\r
32                         \r
33                         // This constructor takes the reason of the exception.\r
34                                 MsgException(const char* reason);\r
35                         \r
36                         // Destructor.\r
37                                 virtual ~MsgException();\r
38                                 \r
39                         // Operations.\r
40                                         \r
41                                         // Returns the reason of the exception :\r
42                                         // the message "Internal exception `reason'"\r
43                                         const char* toString(void) const;\r
44                         \r
45                         // Operators.\r
46                                 \r
47                                 // Assignement.\r
48                                 const MsgException& operator = (const MsgException& rMsgException);\r
49                                 \r
50                         private :\r
51                         \r
52                         // Attributes.\r
53                                 \r
54                                 // A buffer used to build the message returned by the methode toString().\r
55                                 char* reason;\r
56                 };\r
57                 \r
58                 \r
59         } // namespace Msg      \r
60 \r
61 }// namespace SimGrid\r
62 \r
63 \r
64 #endif // !MSG_MSGEXCEPTION_HPP\r