SUMO - Simulation of Urban MObility
RONetHandler.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
17 // The handler that parses a SUMO-network for its usage in a router
18 /****************************************************************************/
19 #ifndef RONetHandler_h
20 #define RONetHandler_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include <string>
32 
33 
34 // ===========================================================================
35 // class declarations
36 // ===========================================================================
37 class RONet;
38 class OptionsCont;
39 class ROEdge;
41 
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
53 class RONetHandler : public SUMOSAXHandler {
54 public:
60  RONetHandler(RONet& net, ROAbstractEdgeBuilder& eb, const bool ignoreInternal);
61 
62 
64  virtual ~RONetHandler();
65 
66 
67 protected:
69 
70 
78  virtual void myStartElement(int element, const SUMOSAXAttributes& attrs);
79 
86  virtual void myEndElement(int element);
88 
89 protected:
91 
92 
104  void parseEdge(const SUMOSAXAttributes& attrs);
105 
106 
115  virtual void parseLane(const SUMOSAXAttributes& attrs);
116 
117 
126  void parseJunction(const SUMOSAXAttributes& attrs);
127 
128 
133  void parseConnection(const SUMOSAXAttributes& attrs);
134 
135 
141  void parseStoppingPlace(const SUMOSAXAttributes& attrs, const SumoXMLTag element);
142 
143 
148  void parseAccess(const SUMOSAXAttributes& attrs);
149 
150 
160  void parseDistrict(const SUMOSAXAttributes& attrs);
161 
162 
174  void parseDistrictEdge(const SUMOSAXAttributes& attrs, bool isSource);
175 
177 
178 
179 protected:
182 
185 
187  const bool myIgnoreInternal;
188 
190  std::string myCurrentName;
191 
193  std::string myCurrentTypeID;
194 
197 
200 
202  std::set<std::string> myUnseenNodeIDs;
203 
204 
205 private:
207  RONetHandler(const RONetHandler& src);
208 
210  RONetHandler& operator=(const RONetHandler& src);
211 
212 };
213 
214 
215 #endif
216 
217 /****************************************************************************/
218 
RONetHandler(RONet &net, ROAbstractEdgeBuilder &eb, const bool ignoreInternal)
Constructor.
std::string myCurrentName
The name of the edge/node that is currently processed.
Definition: RONetHandler.h:190
SumoXMLTag
Numbers representing SUMO-XML - element names.
ROAbstractEdgeBuilder & myEdgeBuilder
The object used to build of edges of the desired type.
Definition: RONetHandler.h:184
SUMOVehicleParameter::Stop * myCurrentStoppingPlace
The currently built stopping place.
Definition: RONetHandler.h:199
void parseDistrict(const SUMOSAXAttributes &attrs)
const bool myIgnoreInternal
whether to ignore junction internal edges
Definition: RONetHandler.h:187
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.
std::set< std::string > myUnseenNodeIDs
temporary data for checking node initialisation after network parsing is finished ...
Definition: RONetHandler.h:202
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
Encapsulated SAX-Attributes.
virtual ~RONetHandler()
Destructor.
A basic edge for routing applications.
Definition: ROEdge.h:72
The router&#39;s network representation.
Definition: RONet.h:68
RONetHandler & operator=(const RONetHandler &src)
Invalidated assignment operator.
Definition of vehicle stop (position and duration)
A storage for options typed value containers)
Definition: OptionsCont.h:92
The handler that parses a SUMO-network for its usage in a router.
Definition: RONetHandler.h:53
RONet & myNet
The net to store the information into.
Definition: RONetHandler.h:181
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
void parseAccess(const SUMOSAXAttributes &attrs)
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 parseStoppingPlace(const SUMOSAXAttributes &attrs, const SumoXMLTag element)