Eclipse 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-2019 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, const double minorPenalty);
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 
179  void setLocation(const SUMOSAXAttributes& attrs);
180 
181 protected:
184 
187 
190 
192  const bool myIgnoreInternal;
193 
195  std::string myCurrentName;
196 
198  std::string myCurrentTypeID;
199 
202 
205 
207  std::set<std::string> myUnseenNodeIDs;
208 
210  const double myMinorPenalty;
211 
212 private:
214  RONetHandler(const RONetHandler& src);
215 
217  RONetHandler& operator=(const RONetHandler& src);
218 
219 };
220 
221 
222 #endif
223 
224 /****************************************************************************/
225 
std::string myCurrentName
The name of the edge/node that is currently processed.
Definition: RONetHandler.h:195
SumoXMLTag
Numbers representing SUMO-XML - element names.
ROAbstractEdgeBuilder & myEdgeBuilder
The object used to build of edges of the desired type.
Definition: RONetHandler.h:189
SUMOVehicleParameter::Stop * myCurrentStoppingPlace
The currently built stopping place.
Definition: RONetHandler.h:204
void parseDistrict(const SUMOSAXAttributes &attrs)
const bool myIgnoreInternal
whether to ignore junction internal edges
Definition: RONetHandler.h:192
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.
RONetHandler(RONet &net, ROAbstractEdgeBuilder &eb, const bool ignoreInternal, const double minorPenalty)
Constructor.
std::set< std::string > myUnseenNodeIDs
temporary data for checking node initialisation after network parsing is finished ...
Definition: RONetHandler.h:207
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:73
Definition of vehicle stop (position and duration)
The router&#39;s network representation.
Definition: RONet.h:64
RONetHandler & operator=(const RONetHandler &src)
Invalidated assignment operator.
A storage for options typed value containers)
Definition: OptionsCont.h:90
const double myMinorPenalty
time penalty for passing a minor link
Definition: RONetHandler.h:210
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:183
void parseConnection(const SUMOSAXAttributes &attrs)
void setLocation(const SUMOSAXAttributes &attrs)
Parses network location description.
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:198
void parseAccess(const SUMOSAXAttributes &attrs)
double myNetworkVersion
the loaded network version
Definition: RONetHandler.h:186
ROEdge * myCurrentEdge
The currently built edge.
Definition: RONetHandler.h:201
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)