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 /****************************************************************************/
16 // The handler that parses a SUMO-network for its usage in a router
17 /****************************************************************************/
18 #ifndef RONetHandler_h
19 #define RONetHandler_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <string>
31 
32 
33 // ===========================================================================
34 // class declarations
35 // ===========================================================================
36 class RONet;
37 class OptionsCont;
38 class ROEdge;
40 
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
52 class RONetHandler : public SUMOSAXHandler {
53 public:
59  RONetHandler(RONet& net, ROAbstractEdgeBuilder& eb, const bool ignoreInternal, const double minorPenalty);
60 
61 
63  virtual ~RONetHandler();
64 
65 
66 protected:
68 
69 
77  virtual void myStartElement(int element, const SUMOSAXAttributes& attrs);
78 
85  virtual void myEndElement(int element);
87 
88 protected:
90 
91 
93  void addParam(const SUMOSAXAttributes& attrs);
94 
106  void parseEdge(const SUMOSAXAttributes& attrs);
107 
108 
117  virtual void parseLane(const SUMOSAXAttributes& attrs);
118 
119 
128  void parseJunction(const SUMOSAXAttributes& attrs);
129 
130 
135  void parseConnection(const SUMOSAXAttributes& attrs);
136 
137 
143  void parseStoppingPlace(const SUMOSAXAttributes& attrs, const SumoXMLTag element);
144 
145 
150  void parseAccess(const SUMOSAXAttributes& attrs);
151 
152 
162  void parseDistrict(const SUMOSAXAttributes& attrs);
163 
164 
176  void parseDistrictEdge(const SUMOSAXAttributes& attrs, bool isSource);
177 
179 
181  void setLocation(const SUMOSAXAttributes& attrs);
182 
183 protected:
186 
189 
192 
194  const bool myIgnoreInternal;
195 
197  std::string myCurrentName;
198 
200  std::string myCurrentTypeID;
201 
204 
207 
209  std::set<std::string> myUnseenNodeIDs;
210 
212  const double myMinorPenalty;
213 
214 private:
216  RONetHandler(const RONetHandler& src);
217 
219  RONetHandler& operator=(const RONetHandler& src);
220 
221 };
222 
223 
224 #endif
225 
226 /****************************************************************************/
227 
RONetHandler::myMinorPenalty
const double myMinorPenalty
time penalty for passing a minor link
Definition: RONetHandler.h:212
RONetHandler
The handler that parses a SUMO-network for its usage in a router.
Definition: RONetHandler.h:52
RONetHandler::myEdgeBuilder
ROAbstractEdgeBuilder & myEdgeBuilder
The object used to build of edges of the desired type.
Definition: RONetHandler.h:191
SUMOSAXHandler
SAX-handler base for SUMO-files.
Definition: SUMOSAXHandler.h:41
RONetHandler::myEndElement
virtual void myEndElement(int element)
Called when a closing tag occurs.
Definition: RONetHandler.cpp:131
RONetHandler::parseAccess
void parseAccess(const SUMOSAXAttributes &attrs)
Definition: RONetHandler.cpp:353
SUMOSAXHandler.h
RONetHandler::RONetHandler
RONetHandler(RONet &net, ROAbstractEdgeBuilder &eb, const bool ignoreInternal, const double minorPenalty)
Constructor.
Definition: RONetHandler.cpp:49
RONetHandler::parseConnection
void parseConnection(const SUMOSAXAttributes &attrs)
Definition: RONetHandler.cpp:283
RONetHandler::addParam
void addParam(const SUMOSAXAttributes &attrs)
assign arbitrary vehicle parameters
Definition: RONetHandler.cpp:146
RONetHandler::setLocation
void setLocation(const SUMOSAXAttributes &attrs)
Parses network location description.
Definition: RONetHandler.cpp:404
RONet
The router's network representation.
Definition: RONet.h:63
RONetHandler::parseStoppingPlace
void parseStoppingPlace(const SUMOSAXAttributes &attrs, const SumoXMLTag element)
Definition: RONetHandler.cpp:325
RONetHandler::parseLane
virtual void parseLane(const SUMOSAXAttributes &attrs)
Parses and builds a lane.
Definition: RONetHandler.cpp:218
SumoXMLTag
SumoXMLTag
Numbers representing SUMO-XML - element names.
Definition: SUMOXMLDefinitions.h:41
RONetHandler::myCurrentStoppingPlace
SUMOVehicleParameter::Stop * myCurrentStoppingPlace
The currently built stopping place.
Definition: RONetHandler.h:206
RONetHandler::myCurrentName
std::string myCurrentName
The name of the edge/node that is currently processed.
Definition: RONetHandler.h:197
RONetHandler::myUnseenNodeIDs
std::set< std::string > myUnseenNodeIDs
temporary data for checking node initialisation after network parsing is finished
Definition: RONetHandler.h:209
SUMOVehicleClass.h
RONetHandler::myStartElement
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
Definition: RONetHandler.cpp:63
RONetHandler::myIgnoreInternal
const bool myIgnoreInternal
whether to ignore junction internal edges
Definition: RONetHandler.h:194
UtilExceptions.h
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
RONetHandler::parseEdge
void parseEdge(const SUMOSAXAttributes &attrs)
Parses and builds an edge.
Definition: RONetHandler.cpp:159
RONetHandler::~RONetHandler
virtual ~RONetHandler()
Destructor.
Definition: RONetHandler.cpp:59
RONetHandler::myCurrentEdge
ROEdge * myCurrentEdge
The currently built edge.
Definition: RONetHandler.h:203
RONetHandler::parseDistrictEdge
void parseDistrictEdge(const SUMOSAXAttributes &attrs, bool isSource)
Definition: RONetHandler.cpp:397
RONetHandler::operator=
RONetHandler & operator=(const RONetHandler &src)
Invalidated assignment operator.
ROEdge
A basic edge for routing applications.
Definition: ROEdge.h:72
config.h
RONetHandler::parseDistrict
void parseDistrict(const SUMOSAXAttributes &attrs)
Definition: RONetHandler.cpp:378
RONetHandler::myCurrentTypeID
std::string myCurrentTypeID
The id of the currently processed edge type.
Definition: RONetHandler.h:200
RONetHandler::parseJunction
void parseJunction(const SUMOSAXAttributes &attrs)
Parses a junction's position.
Definition: RONetHandler.cpp:258
SUMOSAXAttributes
Encapsulated SAX-Attributes.
Definition: SUMOSAXAttributes.h:56
ROAbstractEdgeBuilder
Interface for building instances of router-edges.
Definition: ROAbstractEdgeBuilder.h:53
RONetHandler::myNet
RONet & myNet
The net to store the information into.
Definition: RONetHandler.h:185
SUMOVehicleParameter::Stop
Definition of vehicle stop (position and duration)
Definition: SUMOVehicleParameter.h:572
RONetHandler::myNetworkVersion
double myNetworkVersion
the loaded network version
Definition: RONetHandler.h:188