Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Last Changes of CPP version of Msg
[simgrid.git] / src / cxx / Exception.hpp
1 /*\r
2  * Exception.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_EXCEPTION_HPP\r
14 #define MSG_EXCEPTION_HPP\r
15 \r
16 #include <Config.hpp>\r
17 \r
18 namespace SimGrid\r
19 {\r
20         namespace Msg\r
21         {\r
22                 \r
23                 class SIMGRIDX_EXPORT Exception\r
24                 {\r
25                         public:\r
26                         \r
27                         // Default constructor.\r
28                                 Exception();\r
29                         \r
30                         // Copy constructor.\r
31                                 Exception(const Exception& rException);\r
32                         \r
33                         // This constructor takes the reason of the exception.\r
34                                 Exception(const char* reason);\r
35                         \r
36                         // Destructor.\r
37                                 virtual ~Exception();\r
38                                 \r
39                         // Operations.\r
40                                         \r
41                                         // Returns the reason of the exception.\r
42                                         const char* toString(void) const;\r
43                         \r
44                         // Operators.\r
45                                 \r
46                                 // Assignement.\r
47                                 const Exception& operator = (const Exception& rException);\r
48                                 \r
49                         private :\r
50                         \r
51                         // Attributes.\r
52                                 \r
53                                 // The reason of the exceptions.\r
54                                 const char* reason;\r
55                 };\r
56                 \r
57                 \r
58         } // namespace Msg      \r
59 \r
60 }// namespace SimGrid\r
61 \r
62 \r
63 #endif // !MSG_EXCEPTION_HPP\r