Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
19d2f40f662242a04ff4ca3ee56a8dd5fa99adf2
[simgrid.git] / src / cxx / LogicException.hpp
1 /*\r
2  * LogicException.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_LOGICEXCEPTION_HPP\r
14 #define MSG_LOGICEXCEPTION_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 LogicException : public Exception\r
24                 {\r
25                         public:\r
26                         \r
27                         // Default constructor.\r
28                                 LogicException();\r
29                         \r
30                         // Copy constructor.\r
31                                 LogicException(const LogicException& rLogicException);\r
32                         \r
33                         // This constructor takes the detail of the logic exception.\r
34                                 LogicException(const char* detail);\r
35                         \r
36                         // Destructor.\r
37                                 virtual ~LogicException();\r
38                                 \r
39                         // Operations.\r
40                                         \r
41                                         // Returns the reason of the exception :\r
42                                         // the message "Logic exception `detail'"\r
43                                         const char* toString(void) const;\r
44                         \r
45                         // Operators.\r
46                                 \r
47                                 // Assignement.\r
48                                 const LogicException& operator = (const LogicException& rLogicException);\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_INVALIDARGUMENTEXCEPTION_HPP\r