Logo AND Algorithmique Numérique Distribuée

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