Logo AND Algorithmique Numérique Distribuée

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