openETCS
case study for the European Train Control System developed for the authors dissertation
DSM/Error/ExceptionTypes.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2010-2011
3  Johannes Feuser <feuser@uni-bremen.de>
4  This file is part of the openETCS library.
5 
6  The openETCS library is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  any later version.
10 
11  The openETCS library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with the openETCS library. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 /*!
21  * \author Johannes Feuser <feuser@uni-bremen.de>
22  * \brief module for all exception classes
23  */
24 
25 #ifndef __DSM_ERROR_EXCEPTIONTYPES_H__
26 #define __DSM_ERROR_EXCEPTIONTYPES_H__
27 
28 
29 
30 
31 #include <string>
32 #include <exception>
33 
34 
35 
36 namespace DSM {
37 
38 namespace Error {
39 
40 
41 /*!
42  * \brief general exception type
43  */
44 class CException : public ::std::exception
45 {
46  public:
47  /*!
48  * \brief default constructor
49  *
50  */
51  CException() throw();
52 
53 
54 
55  /*!
56  * \brief general constructor
57  *
58  * \param[in] Message exception message
59  */
60  CException(const ::std::string& Message) throw();
61 
62 
63 
64  /*!
65  * \brief destructor
66  */
67  ~CException() throw();
68 
69 
70 
71  /*!
72  * \brief gets optional error message
73  *
74  * \return error message
75  */
76  ::std::string GetMessage() const throw();
77 
78 
79 
80  /*!
81  * \brief gets exeption message
82  *
83  * Gets the exeption message,
84  * implemented for the base type std::exception.
85  */
86  virtual const char* what() const throw();
87 
88 
89 
90 
91  private:
92  /*!
93  * \brief optional error message
94  */
95  ::std::string m_Message;
96 
97 
98 
99 
100 }; // class CException : public ::std::exception
101 
102 
103 
104 /*!
105  * \brief math exception type
106  */
108 {
109  public:
110  /*!
111  * \brief default/general constructor
112  *
113  * \param[in] Message optional message
114  */
115  CMath(const ::std::string& Message = "") throw();
116 
117 
118 
119 
120 }; // class CMath : public DSM::Error::CException
121 
122 
123 
124 /*!
125  * \brief memory exception type
126  */
128 {
129  public:
130  /*!
131  * \brief default/general constructor
132  *
133  * \param[in] Message optional message
134  */
135  CMemory(const ::std::string& Message = "") throw();
136 
137 
138 
139 
140 }; // class CMemory : public DSM::Error::CException
141 
142 
143 
144 /*!
145  * \brief unknown exception type
146  */
148 {
149  public:
150  /*!
151  * \brief default/general constructor
152  *
153  * \param[in] Message optional message
154  */
155  CUnknown(const ::std::string& Message = "") throw();
156 
157 
158 
159 
160 }; // class CUnknown : public DSM::Error::CException
161 
162 
163 
164 /*!
165  * \brief memory exception type
166  */
168 {
169  public:
170  /*!
171  * \brief default/general constructor
172  *
173  * \param[in] Message optional message
174  */
175  CParser(const ::std::string& Message = "") throw();
176 
177 
178 
179 
180 }; // class CParser : public DSM::Error::CException
181 
182 
183 
184 /*!
185  * \brief parameter exception type
186  */
188 {
189  public:
190  /*!
191  * \brief default/general constructor
192  *
193  * \param[in] Message optional message
194  */
195  CParameter(const ::std::string& Message = "") throw();
196 
197 
198 
199 
200 }; // class CParameter : public DSM::Error::CException
201 
202 
203 
204 
205 
206 } // namespace DSM::Error
207 
208 } // namespace DSM
209 
210 #endif // __ DSM_ERROR_EXCEPTIONTYPES_H__

Copyright (C) 2010-2012 Johannes Feuser (feuser@uni-bremen.de)
The openETCS library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.
The openETCS library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the openETCS library. If not, see "http://www.gnu.org/licenses/.