Eclipse SUMO - Simulation of Urban MObility
NIXMLPTHandler.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 // Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
18 // Importer for static public transport information
19 /****************************************************************************/
20 #pragma once
21 #include <config.h>
22 
26 #include <netbuild/NBEdge.h>
27 #include <netbuild/NBEdgeCont.h>
28 
29 
30 // ===========================================================================
31 // class declarations
32 // ===========================================================================
33 class OptionsCont;
34 class NBNode;
35 class NBEdge;
36 class NBNodeCont;
37 class NBTypeCont;
38 class NBDistrictCont;
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
60 public:
69 
70 
73 
74 protected:
76 
77 
85  void myStartElement(int element,
86  const SUMOSAXAttributes& attrs);
87 
88 
95  void myEndElement(int element);
97 
98 
99 private:
108 
109 
113 
114 
122  bool setNodes(const SUMOSAXAttributes& attrs);
123 
124 
125 private:
126 
129 
132 
135 
137  std::shared_ptr<NBPTStop> myCurrentStop;
138 
141 
143  std::string myCurrentRouteID;
144 
147 
149  std::vector<Parameterised*> myLastParameterised;
150 
152  std::map<std::string, std::vector<std::shared_ptr<NBPTStop> > > myRouteStops;
153  std::map<std::string, EdgeVector > myRouteEdges;
154 
157 
160 
161 private:
162 
166  void addPTStop(const SUMOSAXAttributes& attrs);
167 
171  void addPTLineRoute(const SUMOSAXAttributes& attrs);
172 
177  void addRoute(const SUMOSAXAttributes& attrs);
178 
182  void addPTLineStop(const SUMOSAXAttributes& attrs);
183 
187  void addRouteStop(const SUMOSAXAttributes& attrs);
188 
192  void addAccess(const SUMOSAXAttributes& attrs);
193 
197  void addPTLine(const SUMOSAXAttributes& attrs);
198 
202  void addPTLineFromFlow(const SUMOSAXAttributes& attrs);
203 
204 
205 private:
208 
211 
212 };
LaneSpreadFunction
Numbers representing special SUMO-XML-attribute values Information how the edge's lateral offset shal...
A container for districts.
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:59
The representation of a single edge during network building.
Definition: NBEdge.h:92
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:57
Represents a single node (junction) during network building.
Definition: NBNode.h:66
Container for public transport stops during the net building process.
Definition: NBPTStopCont.h:44
A container for traffic light definitions and built programs.
A storage for available edgeTypes of edges.
Definition: NBTypeCont.h:52
Importer for network edges stored in XML.
NIXMLPTHandler(NBEdgeCont &ec, NBPTStopCont &sc, NBPTLineCont &lc)
Constructor.
void addPTLine(const SUMOSAXAttributes &attrs)
Parses a public transport line.
std::shared_ptr< NBPTStop > myCurrentStop
The currently processed stop.
PositionVector tryGetShape(const SUMOSAXAttributes &attrs)
Tries to parse the shape definition.
~NIXMLPTHandler()
Destructor.
std::map< std::string, std::vector< std::shared_ptr< NBPTStop > > > myRouteStops
stand-alone route information
std::string myCurrentRouteID
The currently processed stand-alone route.
void addPTLineStop(const SUMOSAXAttributes &attrs)
Parses an public transport stop reference within a line element.
void addPTLineFromFlow(const SUMOSAXAttributes &attrs)
Parses a public transport line.
NBPTStopCont & myStopCont
The stop container (for loading of stops)
NIXMLPTHandler(const NIXMLPTHandler &s)
invalid copy constructor
void myEndElement(int element)
Called when a closing tag occurs.
NBEdgeCont & myEdgeCont
The edges container (for retrieving referenced stop edge)
LaneSpreadFunction tryGetLaneSpread(const SUMOSAXAttributes &attrs)
Tries to parse the spread type.
NIXMLPTHandler & operator=(const NIXMLPTHandler &s)
invalid assignment operator
std::map< std::string, EdgeVector > myRouteEdges
NBPTLineCont & myLineCont
The line container (for loading of lines)
bool myCurrentStopWasIgnored
whether the current stop should be discarded
void addPTLineRoute(const SUMOSAXAttributes &attrs)
Parses a route as port of a public transport line.
void addPTStop(const SUMOSAXAttributes &attrs)
Parses an public transport stop.
bool setNodes(const SUMOSAXAttributes &attrs)
Sets from/to node information of the currently parsed edge.
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
std::vector< Parameterised * > myLastParameterised
element to receive parameters
double myCurrentCompletion
the completion level of the current line
void addRoute(const SUMOSAXAttributes &attrs)
Parses a stand-alone route when parsing implicit ptlines from routes and flows.
void addRouteStop(const SUMOSAXAttributes &attrs)
Parses an public transport stop reference within a route element.
void addAccess(const SUMOSAXAttributes &attrs)
Parses an stop access definition.
NBPTLine * myCurrentLine
The currently processed line.
A storage for options typed value containers)
Definition: OptionsCont.h:89
A list of positions.
Encapsulated SAX-Attributes.
SAX-handler base for SUMO-files.