Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Some modifications and some files added.
[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 namespace SimGrid\r
17 {\r
18         namespace Msg\r
19         {\r
20                 \r
21                 class Exception\r
22                 {\r
23                         public:\r
24                         \r
25                         // Default constructor.\r
26                                 Exception();\r
27                         \r
28                         // Copy constructor.\r
29                                 Exception(const Exception& rException);\r
30                         \r
31                         // This constructor takes the reason of the exception.\r
32                                 Exception(const char* reason);\r
33                         \r
34                         // Destructor.\r
35                                 virtual ~Exception();\r
36                                 \r
37                         // Operations.\r
38                                         \r
39                                         // Returns the reason of the exception.\r
40                                         const char* toString(void) const;\r
41                         \r
42                         // Operators.\r
43                                 \r
44                                 // Assignement.\r
45                                 const Exception& operator = (const Exception& rException);\r
46                                 \r
47                         private :\r
48                         \r
49                         // Attributes.\r
50                                 \r
51                                 // The reason of the exceptions.\r
52                                 const char* reason;\r
53                 };\r
54                 \r
55                 \r
56         } // namespace Msg      \r
57 \r
58 }// namespace SimGrid\r
59 \r
60 \r
61 #endif // !MSG_EXCEPTION_HPP\r