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 
RONetHandler::myMinorPenalty
const double myMinorPenalty
time penalty for passing a minor link
Definition: RONetHandler.h:210
RONetHandler
The handler that parses a SUMO-network for its usage in a router.
Definition: RONetHandler.h:53
RONetHandler::myEdgeBuilder
ROAbstractEdgeBuilder & myEdgeBuilder
The object used to build of edges of the desired type.
Definition: RONetHandler.h:189
SUMOSAXHandler
SAX-handler base for SUMO-files.
Definition: SUMOSAXHandler.h:42
RONetHandler::myEndElement
virtual void myEndElement(int element)
Called when a closing tag occurs.
Definition: RONetHandler.cpp:129
RONetHandler::parseAccess
void parseAccess(const SUMOSAXAttributes &attrs)
Definition: RONetHandler.cpp:338
SUMOSAXHandler.h
RONetHandler::RONetHandler
RONetHandler(RONet &net, ROAbstractEdgeBuilder &eb, const bool ignoreInternal, const double minorPenalty)
Constructor.
Definition: RONetHandler.cpp:50
RONetHandler::parseConnection
void parseConnection(const SUMOSAXAttributes &attrs)
Definition: RONetHandler.cpp:268
RONetHandler::setLocation
void setLocation(const SUMOSAXAttributes &attrs)
Parses network location description.
Definition: RONetHandler.cpp:389
RONet
The router's network representation.
Definition: RONet.h:64
RONetHandler::parseStoppingPlace
void parseStoppingPlace(const SUMOSAXAttributes &attrs, const SumoXMLTag element)
Definition: RONetHandler.cpp:310
RONetHandler::parseLane
virtual void parseLane(const SUMOSAXAttributes &attrs)
Parses and builds a lane.
Definition: RONetHandler.cpp:203
SumoXMLTag
SumoXMLTag
Numbers representing SUMO-XML - element names.
Definition: SUMOXMLDefinitions.h:42
RONetHandler::myCurrentStoppingPlace
SUMOVehicleParameter::Stop * myCurrentStoppingPlace
The currently built stopping place.
Definition: RONetHandler.h:204
RONetHandler::myCurrentName
std::string myCurrentName
The name of the edge/node that is currently processed.
Definition: RONetHandler.h:195
RONetHandler::myUnseenNodeIDs
std::set< std::string > myUnseenNodeIDs
temporary data for checking node initialisation after network parsing is finished
Definition: RONetHandler.h:207
SUMOVehicleClass.h
RONetHandler::myStartElement
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
Definition: RONetHandler.cpp:64
RONetHandler::myIgnoreInternal
const bool myIgnoreInternal
whether to ignore junction internal edges
Definition: RONetHandler.h:192
UtilExceptions.h
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:90
RONetHandler::parseEdge
void parseEdge(const SUMOSAXAttributes &attrs)
Parses and builds an edge.
Definition: RONetHandler.cpp:144
RONetHandler::~RONetHandler
virtual ~RONetHandler()
Destructor.
Definition: RONetHandler.cpp:60
RONetHandler::myCurrentEdge
ROEdge * myCurrentEdge
The currently built edge.
Definition: RONetHandler.h:201
RONetHandler::parseDistrictEdge
void parseDistrictEdge(const SUMOSAXAttributes &attrs, bool isSource)
Definition: RONetHandler.cpp:382
RONetHandler::operator=
RONetHandler & operator=(const RONetHandler &src)
Invalidated assignment operator.
ROEdge
A basic edge for routing applications.
Definition: ROEdge.h:73
config.h
RONetHandler::parseDistrict
void parseDistrict(const SUMOSAXAttributes &attrs)
Definition: RONetHandler.cpp:363
RONetHandler::myCurrentTypeID
std::string myCurrentTypeID
The id of the currently processed edge type.
Definition: RONetHandler.h:198
RONetHandler::parseJunction
void parseJunction(const SUMOSAXAttributes &attrs)
Parses a junction's position.
Definition: RONetHandler.cpp:243
SUMOSAXAttributes
Encapsulated SAX-Attributes.
Definition: SUMOSAXAttributes.h:57
ROAbstractEdgeBuilder
Interface for building instances of router-edges.
Definition: ROAbstractEdgeBuilder.h:54
RONetHandler::myNet
RONet & myNet
The net to store the information into.
Definition: RONetHandler.h:183
SUMOVehicleParameter::Stop
Definition of vehicle stop (position and duration)
Definition: SUMOVehicleParameter.h:566
RONetHandler::myNetworkVersion
double myNetworkVersion
the loaded network version
Definition: RONetHandler.h:186