openETCS
case study for the European Train Control System developed for the authors dissertation
Main.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  * \file
22  * \author Johannes Feuser <feuser@uni-bremen.de>
23  * \brief main file for generator binary
24  *
25  * File holding the main() function and CMain class for the openETCS
26  * generator binary execution.
27  */
28 
29 #ifndef __OETCS_GEN_MAIN_H__
30 #define __OETCS_GEN_MAIN_H__
31 
32 
33 #include <unistd.h>
34 
35 #include <string>
36 #include "../../DSM/GOPPRRTransformer.h"
37 #include "CPPGenerator.h"
38 #include "VMgenerator.h"
39 #include "BuildGenerator.h"
40 #include "../../GOPPRR/ConstraintChecker.h"
41 #include <sstream>
42 
43 
44 
45 namespace oETCS {
46 
47 namespace GEN {
48 
49 
50 /*!
51  * \brief generator main class
52  *
53  * Main class holding routines for command line binary.
54  * Typically invoked by main() function. Combines functionality
55  * of all generator, GOPPRR and DSM components.
56  */
57 class CMain
58 {
59  public:
60  /*!
61  * \brief general constructor
62  *
63  * general constructor
64  '
65  ' \param[in] ppArguements argument vector with char pointers
66  * \param[in] iNumberArguments number of arguments in vector
67  */
68  CMain(char ** ppArguements = 0, int iNumberArguments = 0) throw();
69 
70 
71 
72  /*!
73  * \brief destructor
74  *
75  * destructor
76  */
77  virtual ~CMain() throw();
78 
79 
80 
81  /*!
82  * \brief executes the main functionality of the generator
83  *
84  * \return the execution code
85  */
86  int Execute() throw();
87 
88 
89 
90 
91  private:
92  /*!
93  * \brief internal helper method
94  *
95  * Prints the usage of the command line arguments.
96  */
97  void PrintUsage() throw();
98 
99 
100 
101  /*!
102  * \brief flag for printing the usage
103  */
104  bool m_bHelp;
105 
106 
107 
108  /*!
109  * \brief flag for genrating source
110  */
111  bool m_bSource;
112 
113 
114 
115  /*!
116  * \brief flag for genrating build config
117  */
119 
120 
121 
122  /*!
123  * \brief flag for genrating build config
124  */
126 
127 
128 
129  /*!
130  * \brief flag for applying model checking
131  */
133 
134 
135 
136  /*!
137  * \brief literal name of the binary
138  */
139  ::std::string m_BinaryName;
140 
141 
142 
143  /*!
144  * \brief file name of the XML model file
145  */
146  ::std::string m_XMLFile;
147 
148 
149 
150  /*!
151  * \brief constraint file name
152  */
153  ::std::string m_ContraintFile;
154 
155 
156 
157  /*!
158  * \brief output directory for generate files
159  */
160  ::std::string m_OutputDirectory;
161 
162 
163 
164  /*!
165  * \brief lexer object
166  *
167  * Lexer object for creating syntax trees.
168  */
170 
171 
172 
173  /*!
174  * \brief C++ Generator
175  *
176  * C++ generator object.
177  */
179 
180 
181 
182  /*!
183  * \brief VM geneator
184  *
185  * Generator object for configuration files of virtual machines.
186  */
188 
189 
190 
191  /*!
192  * \brief build Generator
193  *
194  * Build generator object.
195  */
197 
198 
199 
200  /*!
201  * \brief contraint checker object
202  */
204 
205 
206 
207  /*!
208  * \brief error message stream
209  */
210  ::std::stringstream m_ErrorMessage;
211 
212 
213 
214 
215 }; // class CMain
216 
217 
218 
219 
220 
221 } // namespace oETCS::GEN
222 
223 } // namespace oETCS
224 
225 #endif // __ OETCS_GEN_MAIN_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/.