Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
A string utility class and a new Exception (used to throw out of band exception)
[simgrid.git] / src / cxx / ClassNotFoundException.hpp
1 /*\r
2  * ClassNotFoundException.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_CLASSNOTFOUNDEXCEPTION_HPP\r
14 #define MSG_CLASSNOTFOUNDEXCEPTION_HPP\r
15 \r
16 #ifndef __cplusplus\r
17         #error ClassNotFoundException.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 ClassNotFoundException : public Exception\r
28                 {\r
29                         public:\r
30                         \r
31                         // Default constructor.\r
32                                 ClassNotFoundException();\r
33                         \r
34                         // Copy constructor.\r
35                                 ClassNotFoundException(const ClassNotFoundException& rClassNotFoundException);\r
36                         \r
37                         // This constructor takes the name of the class not found.\r
38                                 ClassNotFoundException(const char* name);\r
39                         \r
40                         // Destructor.\r
41                                 virtual ~ClassNotFoundException();\r
42                                 \r
43                         // Operations.\r
44                                         \r
45                                         // Returns the reason of the exception :\r
46                                         // the message "Host not found `host name'"\r
47                                         const char* toString(void) const;\r
48                         \r
49                         // Operators.\r
50                                 \r
51                                 // Assignement.\r
52                                 const ClassNotFoundException& operator = (const ClassNotFoundException& rClassNotFoundException);\r
53                                 \r
54                         private :\r
55                         \r
56                         // Attributes.\r
57                                 \r
58                                 // A buffer used to build the message returned by the methode toString().\r
59                                 char* reason;\r
60                 };\r
61                 \r
62                 \r
63         } // namespace Msg      \r
64 \r
65 }// namespace SimGrid\r
66 \r
67 \r
68 #endif // !MSG_CLASSNOTFOUNDEXCEPTION_HPP\r
69 \r