Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make sure we have getline when we use it
[simgrid.git] / src / cxx / OutOfBoundsException.hpp
1 /*
2  * OutOfBoundsException.hpp
3  *
4  * Copyright 2006,2007 Martin Quinson, Malek Cherier           
5  * All right reserved. 
6  *
7  * This program is free software; you can redistribute 
8  * it and/or modify it under the terms of the license 
9  *(GNU LGPL) which comes with this package. 
10  *
11  */  
12  
13 #ifndef MSG_OUTOFBOUNDSEXCEPTION_HPP
14 #define MSG_OUTOFBOUNDSEXCEPTION_HPP
15
16 #ifndef __cplusplus
17         #error OutOfBoundsException.hpp requires C++ compilation (use a .cxx suffix)
18 #endif
19
20 #include <Exception.hpp>
21
22 namespace SimGrid
23 {
24         namespace Msg
25         {
26                 
27                 class SIMGRIDX_EXPORT OutOfBoundsException : public Exception
28                 {
29                         public:
30                         
31                         // Default constructor.
32                                 OutOfBoundsException();
33                         
34                         // Copy constructor.
35                                 OutOfBoundsException(const OutOfBoundsException& rOutOfBoundsException);
36                         
37                         // This constructor takes the position in the range.
38                                 OutOfBoundsException(int pos);
39
40                                 OutOfBoundsException(int pos1, int pos2);
41                         
42                         // Destructor.
43                                 virtual ~OutOfBoundsException();
44                                 
45                         // Operations.
46                                         
47                                         // Returns the reason of the exception :
48                                         // the message "Out of bounds : `pos'"
49                                         const char* toString(void) const;
50                         
51                         // Operators.
52                                 
53                                 // Assignement.
54                                 const OutOfBoundsException& operator = (const OutOfBoundsException& rOutOfBoundsException);
55                                 
56                         private :
57                         
58                         // Attributes.
59                                 
60                                 // A buffer used to build the message returned by the methode toString().
61                                 char* reason;
62                 };
63                 
64                 
65         } // namespace Msg      
66
67 }// namespace SimGrid
68
69
70 #endif // !MSG_MSGEXCEPTION_HPP
71