openETCS
case study for the European Train Control System developed for the authors dissertation
GOPPRRTransformer.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 GOPPRR XML to syntax tree transformer
23  */
24 
25 #ifndef __DSM_GOPPRRTRANSFORMER_H__
26 #define __DSM_GOPPRRTRANSFORMER_H__
27 
28 
29 
30 
31 #include "GOPPRRSyntaxTree.h"
32 #include <string>
33 #include "../GOPPRR/Graph.h"
34 #include "Error/ExceptionTypes.h"
35 #include <fstream>
36 #include <libxml++/nodes/element.h>
37 #include <map>
38 #include "SyntaxTransformer.h"
39 #include <libxml++/nodes/textnode.h>
40 #include "../GOPPRR/Project.h"
41 #include "../GOPPRR/Object.h"
42 #include "../GOPPRR/Port.h"
43 #include "../GOPPRR/Property.h"
44 #include "../GOPPRR/Role.h"
45 #include "../GOPPRR/Relationship.h"
46 #include "../GOPPRR/Connection.h"
47 #include "../GOPPRR/Binding.h"
48 #include "../GOPPRR/GraphicalContainer.h"
49 
50 
51 namespace oETCS { namespace UT { class CGOPPRRTransformer; } }
52 
53 
54 namespace DSM {
55 
56 
57 /*!
58  * \brief XML syntax tree transformer for the GOPPRR meta meta model
59  */
61 {
62  public:
63  /*!
64  * \brief default constructor
65  *
66  * default constructor
67  */
68  CGOPPRRTransformer() throw();
69 
70 
71 
72  /*!
73  * \brief destructor
74  */
75  virtual ~CGOPPRRTransformer() throw();
76 
77 
78 
79  /*!
80  * \brief gets GOPRR syntax tree
81  *
82  * Gets pointer to internal GOPRR syntax tree
83  *
84  * \return pointer to tree
85  */
86  ::DSM::CGOPPRRSyntaxTree* GetGOPRRTree() const throw();
87 
88 
89 
90  /*!
91  * \brief creates a GOPRR syntax tree
92  *
93  * Creates a GOPPRR syntax tree from a XML model file while
94  * using an internalyl stored Schema file for validation.
95  * The create syntax tree is stored in m_pTree.
96  *
97  * \param[in] ModelFileName file name of the XML model file
98  * \param[out] pRootGraph pointer to root graph, if one exists, else 0
99  */
100  void CreateSyntaxFromFile(const ::std::string & ModelFileName, GOPPRR::CGraph *& pRootGraph) throw(DSM::Error::CException);
101 
102 
103 
104  /*!
105  * \brief creates a GOPRR syntax tree
106  *
107  * Creates a GOPPRR syntax tree from a XML model file while
108  * using an internalyl stored Schema file for validation.
109  * The create syntax tree is stored in m_pTree.
110  *
111  * \param[in] ModelFileName file stream of the XML model file
112  * \param[out] pRootGraph pointer to root graph, if one exists, else 0
113  */
114  void CreateSyntax(::std::fstream & ModelFileStream, GOPPRR::CGraph *& pRootGraph) throw(DSM::Error::CException);
115 
116 
117 
118  /*!
119  * \brief creates a GOPRR syntax tree
120  *
121  * Creates a GOPPRR syntax tree from a XML model file while
122  * using an internalyl stored Schema file for validation.
123  * The create syntax tree is stored in m_pTree.
124  *
125  * \param[in] Model XML model as string
126  * \param[out] pRootGraph pointer to root graph, if one exists, else 0
127  */
128  void CreateSyntax(const ::std::string & Model, GOPPRR::CGraph *& pRootGraph) throw(DSM::Error::CException);
129 
130 
131 
132  /*!
133  * \brief creates a GOPRR syntax tree
134  *
135  * Creates a GOPPRR syntax tree from a XML model file while
136  * using an internalyl stored Schema file for validation.
137  * The create syntax tree is stored in m_pTree.
138  *
139  * \remark this methods works itereative and not recursive
140  *
141  * \param[in] Model XML model as string
142  * \param[out] pRootGraph pointer to root graph, if one exists, else 0
143  */
144  void CreateSyntaxIterative(const ::std::string & Model, GOPPRR::CGraph *& pRootGraph) throw(DSM::Error::CException);
145 
146 
147 
148 
149  protected:
150  /*!
151  * \brief internal helper method
152  *
153  * Internal helper method for creating a
154  * GOPRR::CProperty object from a XML element node.
155  *
156  * \param[in] pXMLElement pointer to current XML element object
157  * \param[inout] Graphs set of graphs in current project
158  * \param{inout] Objects: set of objects in current project
159  * \param[inout] Properties set of properties in current project
160  * \param[inout] Ports set of ports in current project
161  * \param[inout] Roles set of roles in current project
162  * \param[inout] Relationships set of relationships in current project
163  */
164  static void CreatePropertyIterative(::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships) throw(DSM::Error::CException);
165 
166 
167 
168  /*!
169  * \brief internal helper method
170  *
171  * Internal helper method for creating a
172  * GOPRR::CObject object from a XML element node.
173  *
174  * \param[in] pXMLElement pointer to current XML element object
175  * \param{inout] Objects: set of objects in current project
176  * \param[inout] Properties set of properties in current project
177 
178  */
179  static void CreateObjectIterative(::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships) throw(DSM::Error::CException);
180 
181 
182 
183  /*!
184  * \brief internal helper method
185  *
186  * Internal helper method for creating a map
187  * of GOPRR::CGraph pointers as explosions from a XML element node.
188  *
189  * \param[in] pXMLElement: pointer to current XML element <gopprr explosions> object
190  * \param[inout] Graphs set of graphs in current project
191  * \param{inout] Objects: set of objects in current project
192  * \param[inout] Properties set of properties in current project
193  * \param[inout] Ports set of ports in current project
194  * \param[inout] Roles set of roles in current project
195  * \param[inout] Relationships set of relationships in current project
196  * \param[out] Explosions set of graph reference as current exlosions
197  */
198  static void CreateExplosionIterative(::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph > & Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty > & Properties, std::map< ::std::string, ::GOPPRR::CPort > & Ports, std::map< ::std::string, ::GOPPRR::CRole > & Roles, std::map< ::std::string, ::GOPPRR::CRelationship > & Relationships, std::map< ::std::string, ::GOPPRR::CGraph* >& Explosions) throw(DSM::Error::CException);
199 
200 
201 
202  /*!
203  * \brief internal helper method
204  *
205  * Internal helper method for creating a
206  * GOPRR::CPort object from a XML element node.
207  *
208  * \param[in] pXMLElement pointer to current XML element object
209  * \param[inout] Graphs set of graphs in current project
210  * \param{inout] Objects: set of objects in current project
211  * \param[inout] Properties set of properties in current project
212  * \param[inout] Ports set of ports in current project
213  * \param[inout] Roles set of roles in current project
214  * \param[inout] Relationships set of relationships in current project
215  */
216  static void CreatePortIterative(::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships) throw(DSM::Error::CException);
217 
218 
219 
220  /*!
221  * \brief internal helper method
222  *
223  * Internal helper method for creating a
224  * GOPRR::CRole object from a XML element node.
225  *
226  * \param[in] pXMLElement pointer to current XML element object
227  * \param[inout] Graphs set of graphs in current project
228  * \param{inout] Objects: set of objects in current project
229  * \param[inout] Properties set of properties in current project
230  * \param[inout] Ports set of ports in current project
231  * \param[inout] Roles set of roles in current project
232  * \param[inout] Relationships set of relationships in current project
233  */
234  static void CreateRoleIterative(::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships) throw(DSM::Error::CException);
235 
236 
237 
238  /*!
239  * \brief internal helper method
240  *
241  * Internal helper method for creating a
242  * GOPRR::CRelationship object from a XML element node.
243  *
244  * \param[in] pXMLElement pointer to current XML element object
245  * \param[inout] Graphs set of graphs in current project
246  * \param{inout] Objects: set of objects in current project
247  * \param[inout] Properties set of properties in current project
248  * \param[inout] Ports set of ports in current project
249  * \param[inout] Roles set of roles in current project
250  * \param[inout] Relationships set of relationships in current project
251  */
252  static void CreateRelationshipIterative(::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships) throw(DSM::Error::CException);
253 
254 
255 
256  /*!
257  * \brief internal helper method
258  *
259  * Internal helper method for creating a
260  * GOPRR::CGraph object from a XML element node.
261  *
262  * \param[in] pXMLElement pointer to current XML element object/graph
263  * \param[inout] Graphs set of graphs in current project
264  * \param{inout] Objects: set of objects in current project
265  * \param[inout] Properties set of properties in current project
266  * \param[inout] Ports set of ports in current project
267  * \param[inout] Roles set of roles in current project
268  * \param[inout] Relationships set of relationships in current project
269  * \param[out] bRoot flag, if graph is root graph
270  */
271  static void CreateGraphIterative(::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph > & Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort > & Ports, std::map< ::std::string, ::GOPPRR::CRole > & Roles, std::map< ::std::string, ::GOPPRR::CRelationship > & Relationships, bool& bRoot) throw(DSM::Error::CException);
272 
273 
274 
275  /*!
276  * \brief internal helper method
277  *
278  * Internal helper method for creating a
279  * GOPRR::CGraph object from a XML element node.
280  *
281  * \param[in] pXMLElement pointer to current XML element object/graph
282  * \param[inout] Graphs set of graphs in current project
283  * \param{inout] Objects: set of objects in current project
284  * \param[inout] Properties set of properties in current project
285  * \param[inout] Ports set of ports in current project
286  * \param[inout] Roles set of roles in current project
287  * \param[inout] Relationships set of relationships in current project
288  * \param[out] bRoot flag, if graph is root graph
289  */
290  static void CreateGraph(::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph > & Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort > & Ports, std::map< ::std::string, ::GOPPRR::CRole > & Roles, std::map< ::std::string, ::GOPPRR::CRelationship > & Relationships, bool& bRoot) throw(DSM::Error::CException);
291 
292 
293 
294  /*!
295  * \brief internal helper method
296  *
297  * Internal helper method for creating a
298  * GOPRR::CGraph object from a XML element node,
299  * if it does not exist yet.
300  *
301  * \param[in] OID object identifier of object
302  * \param[in] pXMLElement pointer current XML element
303  * \param[inout] Graphs set of graphs in current project
304  * \param{inout] Objects: set of objects in current project
305  * \param[inout] Properties set of properties in current project
306  * \param[inout] Ports set of ports in current project
307  * \param[inout] Roles set of roles in current project
308  * \param[inout] Relationships set of relationships in current project
309  * \param[out] bRoot flag, if graph is root graph
310  */
311  static void CreateGraph(const ::std::string& OID, ::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships, bool& bRoot) throw(DSM::Error::CException);
312 
313 
314 
315  /*!
316  * \brief internal helper method
317  *
318  * Internal helper method for creating a
319  * GOPRR::CObject object from a XML element node.
320  *
321  * \param[in] pXMLElement pointer to current XML element object
322  * \param{inout] Objects: set of objects in current project
323  * \param[inout] Properties set of properties in current project
324 
325  */
326  static void CreateObject(::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships) throw(DSM::Error::CException);
327 
328 
329 
330  /*!
331  * \brief internal helper method
332  *
333  * Internal helper method for creating a
334  * GOPRR::CObject object from a XML element node,
335  * if it does not exist yet.
336  *
337  * \param[in] OID object identifier of object
338  * \param[in] pXMLElement pointer current XML element
339  * \param[inout] Graphs set of graphs in current project
340  * \param{inout] Objects: set of objects in current project
341  * \param[inout] Properties set of properties in current project
342  * \param[inout] Ports set of ports in current project
343  * \param[inout] Roles set of roles in current project
344  * \param[inout] Relationships set of relationships in current project
345  */
346  static void CreateObject(const ::std::string& OID, ::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships) throw(DSM::Error::CException);
347 
348 
349 
350  /*!
351  * \brief internal helper method
352  *
353  * Internal helper method for creating a
354  * GOPRR::CPort object from a XML element node.
355  *
356  * \param[in] pXMLElement pointer to current XML element object
357  * \param[inout] Graphs set of graphs in current project
358  * \param{inout] Objects: set of objects in current project
359  * \param[inout] Properties set of properties in current project
360  * \param[inout] Ports set of ports in current project
361  * \param[inout] Roles set of roles in current project
362  * \param[inout] Relationships set of relationships in current project
363  */
364  static void CreatePort(::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships) throw(DSM::Error::CException);
365 
366 
367 
368  /*!
369  * \brief internal helper method
370  *
371  * Internal helper method for creating a
372  * GOPRR::CPort object from a XML element node,
373  * if it does not exist yet.
374  *
375  * \param[in] OID object identifier of object
376  * \param[in] pXMLElement pointer current XML element
377  * \param[inout] Graphs set of graphs in current project
378  * \param{inout] Objects: set of objects in current project
379  * \param[inout] Properties set of properties in current project
380  * \param[inout] Ports set of ports in current project
381  * \param[inout] Roles set of roles in current project
382  * \param[inout] Relationships set of relationships in current project
383  */
384  static void CreatePort(const ::std::string& OID, ::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships) throw(DSM::Error::CException);
385 
386 
387 
388  /*!
389  * \brief internal helper method
390  *
391  * Internal helper method for creating a
392  * GOPRR::CProperty object from a XML element node.
393  *
394  * \param[in] pXMLElement pointer to current XML element object
395  * \param[inout] Graphs set of graphs in current project
396  * \param{inout] Objects: set of objects in current project
397  * \param[inout] Properties set of properties in current project
398  * \param[inout] Ports set of ports in current project
399  * \param[inout] Roles set of roles in current project
400  * \param[inout] Relationships set of relationships in current project
401  */
402  static void CreateProperty(::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships) throw(DSM::Error::CException);
403 
404 
405 
406  /*!
407  * \brief internal helper method
408  *
409  * Internal helper method for creating a
410  * GOPRR::CProperty object from a XML element node,
411  * if it does not exist yet.
412  *
413  * \param[in] OID object identifier of object
414  * \param[in] pXMLElement pointer current XML element
415  * \param[inout] Graphs set of graphs in current project
416  * \param{inout] Objects: set of objects in current project
417  * \param[inout] Properties set of properties in current project
418  * \param[inout] Ports set of ports in current project
419  * \param[inout] Roles set of roles in current project
420  * \param[inout] Relationships set of relationships in current project
421  */
422  static void CreateProperty(const ::std::string& OID, ::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships) throw(DSM::Error::CException);
423 
424 
425 
426  /*!
427  * \brief internal helper method
428  *
429  * Internal helper method for creating a
430  * GOPRR::CRole object from a XML element node.
431  *
432  * \param[in] pXMLElement pointer to current XML element object
433  * \param[inout] Graphs set of graphs in current project
434  * \param{inout] Objects: set of objects in current project
435  * \param[inout] Properties set of properties in current project
436  * \param[inout] Ports set of ports in current project
437  * \param[inout] Roles set of roles in current project
438  * \param[inout] Relationships set of relationships in current project
439  */
440  static void CreateRole(::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships) throw(DSM::Error::CException);
441 
442 
443 
444  /*!
445  * \brief internal helper method
446  *
447  * Internal helper method for creating a
448  * GOPRR::CRole object from a XML element node,
449  * if it does not exist yet.
450  *
451  * \param[in] OID object identifier of object
452  * \param[in] pXMLElement pointer current XML element
453  * \param[inout] Graphs set of graphs in current project
454  * \param{inout] Objects: set of objects in current project
455  * \param[inout] Properties set of properties in current project
456  * \param[inout] Ports set of ports in current project
457  * \param[inout] Roles set of roles in current project
458  * \param[inout] Relationships set of relationships in current project
459  */
460  static void CreateRole(const ::std::string& OID, ::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships) throw(DSM::Error::CException);
461 
462 
463 
464  /*!
465  * \brief internal helper method
466  *
467  * Internal helper method for creating a
468  * GOPRR::CRelationship object from a XML element node.
469  *
470  * \param[in] pXMLElement pointer to current XML element object
471  * \param[inout] Graphs set of graphs in current project
472  * \param{inout] Objects: set of objects in current project
473  * \param[inout] Properties set of properties in current project
474  * \param[inout] Ports set of ports in current project
475  * \param[inout] Roles set of roles in current project
476  * \param[inout] Relationships set of relationships in current project
477  */
478  static void CreateRelationship(::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships) throw(DSM::Error::CException);
479 
480 
481 
482  /*!
483  * \brief internal helper method
484  *
485  * Internal helper method for creating a
486  * GOPRR::CRelationship object from a XML element node,
487  * if it does not exist yet.
488  *
489  * \param[in] OID object identifier of object
490  * \param[in] pXMLElement pointer current XML element
491  * \param[inout] Graphs set of graphs in current project
492  * \param{inout] Objects: set of objects in current project
493  * \param[inout] Properties set of properties in current project
494  * \param[inout] Ports set of ports in current project
495  * \param[inout] Roles set of roles in current project
496  * \param[inout] Relationships set of relationships in current project
497  */
498  static void CreateRelationship(const ::std::string& OID, ::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph >& Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty >& Properties, std::map< ::std::string, ::GOPPRR::CPort >& Ports, std::map< ::std::string, ::GOPPRR::CRole >& Roles, std::map< ::std::string, ::GOPPRR::CRelationship >& Relationships) throw(DSM::Error::CException);
499 
500 
501 
502  /*!
503  * \brief internal helper method
504  *
505  * Internal helper method for creating a map
506  * of GOPRR::CGraph pointers as explosions from a XML element node.
507  *
508  * \param[in] pXMLElement: pointer to current XML element <gopprr explosions> object
509  * \param[inout] Graphs set of graphs in current project
510  * \param{inout] Objects: set of objects in current project
511  * \param[inout] Properties set of properties in current project
512  * \param[inout] Ports set of ports in current project
513  * \param[inout] Roles set of roles in current project
514  * \param[inout] Relationships set of relationships in current project
515  * \param[out] Explosions set of graph reference as current exlosions
516  */
517  static void CreateExplosion(::xmlpp::Element * pXMLElement, std::map< ::std::string, ::GOPPRR::CGraph > & Graphs, std::map< ::std::string, ::GOPPRR::CObject > & Objects, std::map< ::std::string, ::GOPPRR::CProperty > & Properties, std::map< ::std::string, ::GOPPRR::CPort > & Ports, std::map< ::std::string, ::GOPPRR::CRole > & Roles, std::map< ::std::string, ::GOPPRR::CRelationship > & Relationships, std::map< ::std::string, ::GOPPRR::CGraph* >& Explosions) throw(DSM::Error::CException);
518 
519 
520 
521  /*!
522  * \brief internal helper method
523  *
524  * Internal helper method for finding a XML
525  * element by an XPath expression and its OID.
526  *
527  * \param[in] pXMLElement pointer to any XML element of docuement
528  * \param[in] XPath XPath expression
529  * \param[in] OID GOPPRR oid of element
530  */
531  static ::xmlpp::Element* FindElementByXPath(const ::xmlpp::Element * pXMLElement, const ::std::string & XPath, const ::std::string & OID) throw();
532 
533 
534 
535 
536  private:
537  /*!
538  * \brief XML schema for validation of GOPPRR model files
539  */
540  static ::std::string m_Schema;
541 
542 
543 
544 
545 // only include the following, if unit test framework is available
546 #ifdef __HAS_UNIT_TEST__
547 
549 
550 #endif // #ifdef __HAS_UNIT_TEST__
551 
552 }; // class CGOPPRRTransformer : public ::DSM::CSyntaxTransformer
553 
554 
555 
556 
557 
558 } // namespace DSM
559 
560 #endif // __ DSM_GOPPRRTRANSFORMER_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/.