Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
379c76856adf12530db259f071b15f5fdceae170
[simgrid.git] / src / cxx / OutOfBoundsException.hpp
1 /*\r
2  * OutOfBoundsException.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_OUTOFBOUNDSEXCEPTION_HPP\r
14 #define MSG_OUTOFBOUNDSEXCEPTION_HPP\r
15 \r
16 #ifndef __cplusplus\r
17         #error OutOfBoundsException.hpp requires C++ compilation (use a .cxx suffix)\r
18 #endif\r
19 \r
20 #include <Exception.hpp>\r
21 \r
22 namespace SimGrid\r
23 {\r
24         namespace Msg\r
25         {\r
26                 \r
27                 class SIMGRIDX_EXPORT OutOfBoundsException : public Exception\r
28                 {\r
29                         public:\r
30                         \r
31                         // Default constructor.\r
32                                 OutOfBoundsException();\r
33                         \r
34                         // Copy constructor.\r
35                                 OutOfBoundsException(const OutOfBoundsException& rOutOfBoundsException);\r
36                         \r
37                         // This constructor takes the position in the range.\r
38                                 OutOfBoundsException(int pos);\r
39 \r
40                                 OutOfBoundsException(int pos1, int pos2);\r
41                         \r
42                         // Destructor.\r
43                                 virtual ~OutOfBoundsException();\r
44                                 \r
45                         // Operations.\r
46                                         \r
47                                         // Returns the reason of the exception :\r
48                                         // the message "Out of bounds : `pos'"\r
49                                         const char* toString(void) const;\r
50                         \r
51                         // Operators.\r
52                                 \r
53                                 // Assignement.\r
54                                 const OutOfBoundsException& operator = (const OutOfBoundsException& rOutOfBoundsException);\r
55                                 \r
56                         private :\r
57                         \r
58                         // Attributes.\r
59                                 \r
60                                 // A buffer used to build the message returned by the methode toString().\r
61                                 char* reason;\r
62                 };\r
63                 \r
64                 \r
65         } // namespace Msg      \r
66 \r
67 }// namespace SimGrid\r
68 \r
69 \r
70 #endif // !MSG_MSGEXCEPTION_HPP\r
71 \r