openETCS
case study for the European Train Control System developed for the authors dissertation
oETCS/GEN/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 exception types of the generator namespace file
23  */
24 
25 #ifndef __OETCS_GEN_ERROR_EXCEPTIONTYPES_H__
26 #define __OETCS_GEN_ERROR_EXCEPTIONTYPES_H__
27 
28 
29 
30 
31 #include <string>
32 #include <exception>
33 
34 
35 
36 
37 
38 namespace oETCS {
39 
40 namespace GEN {
41 
42 namespace Error {
43 
44 
45 /*!
46  * \brief general exception type for the domain framework
47  */
48 class CException : public ::std::exception
49 {
50  public:
51  /*!
52  * \brief default constructor
53  *
54  */
55  CException() throw();
56 
57 
58 
59  /*!
60  * \brief general constructor
61  *
62  * \param[in] Message exception message
63  */
64  CException(const ::std::string& Message) throw();
65 
66 
67 
68  /*!
69  * \brief destructor
70  */
71  ~CException() throw();
72 
73 
74 
75  /*!
76  * \brief gets optional error message
77  *
78  * \return error message
79  */
80  ::std::string GetMessage() const throw();
81 
82 
83 
84  /*!
85  * \brief gets exeption message
86  *
87  * Gets the exeption message,
88  * implemented for the base type std::exception.
89  */
90  virtual const char* what() const throw();
91 
92 
93 
94 
95  private:
96  /*!
97  * \brief optional error message
98  */
99  ::std::string m_Message;
100 
101 
102 
103 
104 }; // class CException : public ::std::exception
105 
106 
107 
108 /*!
109  * \brief exception type for erronous parameters
110  */
112 {
113  public:
114  /*!
115  * \brief default/general constructor
116  *
117  * \param[in] Message oprional literal exception description
118  */
119  CParameter(const ::std::string& Message = "") throw();
120 
121 
122 
123 
124 }; // class CParameter : public ::oETCS::GEN::Error::CException
125 
126 
127 
128 /*!
129  * \brief exception type for model errors
130  */
132 {
133  public:
134  /*!
135  * \brief default/general constructor
136  *
137  * \param[in] Message optional literal exception description
138  */
139  CModel(const ::std::string& Message = "") throw();
140 
141 
142 
143 
144 }; // class CModel : public ::oETCS::GEN::Error::CException
145 
146 
147 
148 
149 
150 } // namespace oETCS::GEN::Error
151 
152 } // namespace oETCS::GEN
153 
154 } // namespace oETCS
155 
156 #endif // __ OETCS_GEN_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/.