openETCS
case study for the European Train Control System developed for the authors dissertation
oETCS/DF/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 classes as exception types
23  */
24 
25 #ifndef __OETCS_DF_ERROR_EXCEPTIONTYPES_H__
26 #define __OETCS_DF_ERROR_EXCEPTIONTYPES_H__
27 
28 
29 
30 
31 #include <string>
32 #include <exception>
33 
34 
35 
36 namespace oETCS {
37 
38 namespace DF {
39 
40 namespace Error {
41 
42 
43 /*!
44  * \brief general exception type for the domain framework
45  */
46 class CException : public ::std::exception
47 {
48  public:
49  /*!
50  * \brief default constructor
51  *
52  */
53  CException() throw();
54 
55 
56 
57  /*!
58  * \brief general constructor
59  *
60  * \param[in] Message exception message
61  */
62  CException(const ::std::string& Message) throw();
63 
64 
65 
66  /*!
67  * \brief destructor
68  */
69  ~CException() throw();
70 
71 
72 
73  /*!
74  * \brief gets optional error message
75  *
76  * \return error message
77  */
78  ::std::string GetMessage() const throw();
79 
80 
81 
82  /*!
83  * \brief gets exeption message
84  *
85  * Gets the exeption message,
86  * implemented for the base type std::exception.
87  */
88  virtual const char* what() const throw();
89 
90 
91 
92 
93  private:
94  /*!
95  * \brief optional error message
96  */
97  ::std::string m_Message;
98 
99 
100 
101 
102 }; // class CException : public ::std::exception
103 
104 
105 
106 /*!
107  * \brief exeception type for errors in calculations
108  */
110 {
111  public:
112  /*!
113  * \brief default/general constructor
114  *
115  * \param[in] Message optional error message/description
116  */
117  CMath(const std::string& Message = "") throw();
118 
119 
120 
121 
122 }; // class CMath : public ::oETCS::DF::Error::CException
123 
124 
125 
126 /*!
127  * \brief exeception type for errors in calculations by false input values
128  */
130 {
131  public:
132  /*!
133  * \brief default/general constructor
134  *
135  * \param[in] Message optional error message/description
136  */
137  CInput(const std::string& Message = "") throw();
138 
139 
140 
141 
142 }; // class CInput : public ::oETCS::DF::Error::CException
143 
144 
145 
146 /*!
147  * \brief exeception type for internal errors
148  */
150 {
151  public:
152  /*!
153  * \brief default/general constructor
154  *
155  * \param[in] Message optional error message/description
156  */
157  CInternal(const std::string& Message = "") throw();
158 
159 
160 
161 
162 }; // class CInternal : public ::oETCS::DF::Error::CException
163 
164 
165 
166 /*!
167  * \brief exeception type for unknown error types
168  */
170 {
171  public:
172  /*!
173  * \brief default/general constructor
174  *
175  * \param[in] Message optional error message/description
176  */
177  CUnkown(const std::string& Message = "") throw();
178 
179 
180 
181 
182 }; // class CUnkown : public ::oETCS::DF::Error::CException
183 
184 
185 
186 
187 
188 } // namespace oETCS::DF::Error
189 
190 } // namespace oETCS::DF
191 
192 } // namespace oETCS
193 
194 #endif // __ OETCS_DF_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/.