SUMO - Simulation of Urban MObility
RONetHandler.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // The handler that parses a SUMO-network for its usage in a router
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef RONetHandler_h
23 #define RONetHandler_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <string>
39 
40 
41 // ===========================================================================
42 // class declarations
43 // ===========================================================================
44 class RONet;
45 class OptionsCont;
46 class ROEdge;
48 
49 
50 // ===========================================================================
51 // class definitions
52 // ===========================================================================
60 class RONetHandler : public SUMOSAXHandler {
61 public:
68 
69 
71  virtual ~RONetHandler();
72 
73 
74 protected:
76 
77 
85  virtual void myStartElement(int element, const SUMOSAXAttributes& attrs);
86 
93  virtual void myEndElement(int element);
95 
96 protected:
98 
99 
111  void parseEdge(const SUMOSAXAttributes& attrs);
112 
113 
122  virtual void parseLane(const SUMOSAXAttributes& attrs);
123 
124 
133  void parseJunction(const SUMOSAXAttributes& attrs);
134 
135 
140  void parseConnection(const SUMOSAXAttributes& attrs);
141 
142 
147  void parseBusStop(const SUMOSAXAttributes& attrs);
148 
149 
154  void parseContainerStop(const SUMOSAXAttributes& attrs);
155 
156 
166  void parseDistrict(const SUMOSAXAttributes& attrs);
167 
168 
180  void parseDistrictEdge(const SUMOSAXAttributes& attrs, bool isSource);
181 
183 
184 
185 protected:
188 
190  std::string myCurrentName;
191 
193  std::string myCurrentTypeID;
194 
197 
199  bool myProcess;
200 
203 
205  typedef std::map<std::string, std::pair<std::string, std::string> > JunctionGraph;
206  JunctionGraph myJunctionGraph;
207 
208 
209 private:
211  RONetHandler(const RONetHandler& src);
212 
214  RONetHandler& operator=(const RONetHandler& src);
215 
216 };
217 
218 
219 #endif
220 
221 /****************************************************************************/
222 
std::string myCurrentName
The name of the edge/node that is currently processed.
Definition: RONetHandler.h:190
ROAbstractEdgeBuilder & myEdgeBuilder
The object used to build of edges of the desired type.
Definition: RONetHandler.h:202
void parseDistrict(const SUMOSAXAttributes &attrs)
void parseJunction(const SUMOSAXAttributes &attrs)
Parses a junction&#39;s position.
virtual void parseLane(const SUMOSAXAttributes &attrs)
Parses and builds a lane.
SAX-handler base for SUMO-files.
Interface for building instances of router-edges.
JunctionGraph myJunctionGraph
Definition: RONetHandler.h:206
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
RONetHandler(RONet &net, ROAbstractEdgeBuilder &eb)
Constructor.
Encapsulated SAX-Attributes.
void parseBusStop(const SUMOSAXAttributes &attrs)
virtual ~RONetHandler()
Destructor.
A basic edge for routing applications.
Definition: ROEdge.h:73
The router&#39;s network representation.
Definition: RONet.h:72
RONetHandler & operator=(const RONetHandler &src)
Invalidated assignment operator.
A storage for options typed value containers)
Definition: OptionsCont.h:108
The handler that parses a SUMO-network for its usage in a router.
Definition: RONetHandler.h:60
RONet & myNet
The net to store the information into.
Definition: RONetHandler.h:187
void parseConnection(const SUMOSAXAttributes &attrs)
virtual void myEndElement(int element)
Called when a closing tag occurs.
std::string myCurrentTypeID
The id of the currently processed edge type.
Definition: RONetHandler.h:193
std::map< std::string, std::pair< std::string, std::string > > JunctionGraph
temporary data for building the junction graph after network parsing is finished
Definition: RONetHandler.h:205
bool myProcess
An indicator whether the next edge shall be read (internal edges are not read by now) ...
Definition: RONetHandler.h:199
ROEdge * myCurrentEdge
The currently built edge.
Definition: RONetHandler.h:196
void parseDistrictEdge(const SUMOSAXAttributes &attrs, bool isSource)
void parseEdge(const SUMOSAXAttributes &attrs)
Parses and builds an edge.
void parseContainerStop(const SUMOSAXAttributes &attrs)