Eclipse SUMO - Simulation of Urban MObility
NIXMLEdgesHandler.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 // Importer for network edges stored in XML
18 /****************************************************************************/
19 #ifndef NIXMLEdgesHandler_h
20 #define NIXMLEdgesHandler_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
31 #include <netbuild/NBEdge.h>
32 #include <netbuild/NBEdgeCont.h>
33 
34 
35 // ===========================================================================
36 // class declarations
37 // ===========================================================================
38 class OptionsCont;
39 class NBNode;
40 class NBEdge;
41 class NBNodeCont;
42 class NBTypeCont;
43 class NBDistrictCont;
45 
46 // ===========================================================================
47 // class definitions
48 // ===========================================================================
65 public:
74  NBTypeCont& tc, NBDistrictCont& dc,
76  OptionsCont& options);
77 
78 
81 
82 protected:
84 
85 
93  void myStartElement(int element,
94  const SUMOSAXAttributes& attrs);
95 
96 
103  void myEndElement(int element);
105 
106 
107 private:
116 
117 
121 
122 
130  bool setNodes(const SUMOSAXAttributes& attrs);
131 
132 
133 private:
136 
137 
140 
142  std::string myCurrentID;
143 
146 
149 
152 
155 
158 
160  std::string myCurrentStreetName;
161 
163  std::string myCurrentType;
164 
167 
169  double myLength;
170 
173 
176 
179 
182 
185 
188 
190 
191 
194 
195 
198 
201 
204 
207 
210 
215 
216 
219 
222 
224  std::vector<NBEdgeCont::Split> mySplits;
225 
230  public:
232  explicit split_by_pos_finder(double pos)
233  : myPosition(pos) { }
234 
236  bool operator()(const NBEdgeCont::Split& e) {
237  return e.pos == myPosition;
238  }
239 
240  private:
242  double myPosition;
243 
244  };
245 
246 
249 
252 
254 
256  const bool myKeepEdgeShape;
257 
259  std::vector<Parameterised*> myLastParameterised;
260 
261 private:
262 
266  void addEdge(const SUMOSAXAttributes& attrs);
267 
271  void deleteEdge(const SUMOSAXAttributes& attrs);
272 
277  void addLane(const SUMOSAXAttributes& attrs);
278 
283  void addSplit(const SUMOSAXAttributes& attrs);
284 
288  void addRoundabout(const SUMOSAXAttributes& attrs);
289 
290 
291 private:
294 
297 
298 };
299 
300 
301 #endif
302 
303 /****************************************************************************/
304 
NIXMLEdgesHandler::addSplit
void addSplit(const SUMOSAXAttributes &attrs)
Parses a split and stores it in mySplits. Splits are executed Upon reading the end tag of an edge.
Definition: NIXMLEdgesHandler.cpp:400
NIXMLEdgesHandler
Importer for network edges stored in XML.
Definition: NIXMLEdgesHandler.h:64
NIXMLEdgesHandler::myEndElement
void myEndElement(int element)
Called when a closing tag occurs.
Definition: NIXMLEdgesHandler.cpp:560
NIXMLEdgesHandler::operator=
NIXMLEdgesHandler & operator=(const NIXMLEdgesHandler &s)
invalid assignment operator
NIXMLEdgesHandler::myIsUpdate
bool myIsUpdate
Whether this edge definition is an update of a previously inserted edge.
Definition: NIXMLEdgesHandler.h:193
NBEdgeCont
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:60
SUMOSAXHandler
SAX-handler base for SUMO-files.
Definition: SUMOSAXHandler.h:41
NIXMLEdgesHandler::myLastParameterised
std::vector< Parameterised * > myLastParameterised
element to receive parameters
Definition: NIXMLEdgesHandler.h:259
NBTrafficLightLogicCont
A container for traffic light definitions and built programs.
Definition: NBTrafficLightLogicCont.h:57
NIXMLEdgesHandler::split_by_pos_finder::split_by_pos_finder
split_by_pos_finder(double pos)
Constructor.
Definition: NIXMLEdgesHandler.h:232
NIXMLEdgesHandler::myEdgeCont
NBEdgeCont & myEdgeCont
The edges container (for insertion of build edges)
Definition: NIXMLEdgesHandler.h:203
NIXMLEdgesHandler::myCurrentSpeed
double myCurrentSpeed
The current edge's maximum speed.
Definition: NIXMLEdgesHandler.h:145
SUMOSAXHandler.h
NIXMLEdgesHandler::myOptions
OptionsCont & myOptions
A reference to the program's options.
Definition: NIXMLEdgesHandler.h:135
NBEdgeCont.h
NIXMLEdgesHandler::NIXMLEdgesHandler
NIXMLEdgesHandler(NBNodeCont &nc, NBEdgeCont &ec, NBTypeCont &tc, NBDistrictCont &dc, NBTrafficLightLogicCont &tlc, OptionsCont &options)
Constructor.
Definition: NIXMLEdgesHandler.cpp:55
NIXMLEdgesHandler::myTypeCont
NBTypeCont & myTypeCont
The types container (for retrieval of type defaults)
Definition: NIXMLEdgesHandler.h:206
NIXMLEdgesHandler::addEdge
void addEdge(const SUMOSAXAttributes &attrs)
Parses an edge and stores the values in "myCurrentEdge".
Definition: NIXMLEdgesHandler.cpp:155
PositionVector
A list of positions.
Definition: PositionVector.h:45
NBDistrictCont
A container for districts.
Definition: NBDistrictCont.h:52
NIXMLEdgesHandler::myReinitKeepEdgeShape
bool myReinitKeepEdgeShape
Whether the edge shape shall be kept at reinitilization.
Definition: NIXMLEdgesHandler.h:181
NBNodeCont
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:59
NBEdge
The representation of a single edge during network building.
Definition: NBEdge.h:91
NIXMLEdgesHandler::split_by_pos_finder
Finds a split at the given position.
Definition: NIXMLEdgesHandler.h:229
NIXMLEdgesHandler::myCurrentEndOffset
double myCurrentEndOffset
The current edge's offset till the destination node.
Definition: NIXMLEdgesHandler.h:157
NIXMLEdgesHandler::NIXMLEdgesHandler
NIXMLEdgesHandler(const NIXMLEdgesHandler &s)
invalid copy constructor
NIXMLEdgesHandler::myCurrentType
std::string myCurrentType
The current edge's type.
Definition: NIXMLEdgesHandler.h:163
SVCPermissions
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
Definition: SUMOVehicleClass.h:218
SUMOVehicleClass.h
NIXMLEdgesHandler::myBikeLaneWidth
double myBikeLaneWidth
The width of the bike lane that shall be added to the current edge.
Definition: NIXMLEdgesHandler.h:187
NIXMLEdgesHandler::mySidewalkWidth
double mySidewalkWidth
The width of the sidewalk that shall be added to the current edge.
Definition: NIXMLEdgesHandler.h:184
NIXMLEdgesHandler::myShape
PositionVector myShape
The shape of the edge.
Definition: NIXMLEdgesHandler.h:172
NIXMLEdgesHandler::myHaveReportedAboutOverwriting
bool myHaveReportedAboutOverwriting
Information whether at least one edge's attributes were overwritten.
Definition: NIXMLEdgesHandler.h:248
NIXMLEdgesHandler::myNodeCont
NBNodeCont & myNodeCont
The nodes container (for retrieval of referenced nodes)
Definition: NIXMLEdgesHandler.h:200
NIXMLEdgesHandler::myTLLogicCont
NBTrafficLightLogicCont & myTLLogicCont
The traffic lights container to add built tls to (when invalidating tls because of splits)
Definition: NIXMLEdgesHandler.h:213
NIXMLEdgesHandler::myFromNode
NBNode * myFromNode
The nodes the edge starts and ends at.
Definition: NIXMLEdgesHandler.h:166
NIXMLEdgesHandler::split_by_pos_finder::myPosition
double myPosition
The position to search for.
Definition: NIXMLEdgesHandler.h:242
NIXMLEdgesHandler::myLength
double myLength
The current edge's length.
Definition: NIXMLEdgesHandler.h:169
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
NIXMLEdgesHandler::myCurrentEdge
NBEdge * myCurrentEdge
The currently processed edge.
Definition: NIXMLEdgesHandler.h:218
NIXMLEdgesHandler::~NIXMLEdgesHandler
~NIXMLEdgesHandler()
Destructor.
Definition: NIXMLEdgesHandler.cpp:77
NBEdgeCont::Split::pos
double pos
The position of this change.
Definition: NBEdgeCont.h:209
NIXMLEdgesHandler::split_by_pos_finder::operator()
bool operator()(const NBEdgeCont::Split &e)
Comparing operator.
Definition: NIXMLEdgesHandler.h:236
NIXMLEdgesHandler::myHaveWarnedAboutDeprecatedLaneId
bool myHaveWarnedAboutDeprecatedLaneId
Definition: NIXMLEdgesHandler.h:253
NIXMLEdgesHandler::myDistrictCont
NBDistrictCont & myDistrictCont
The districts container (needed if an edge must be split)
Definition: NIXMLEdgesHandler.h:209
NIXMLEdgesHandler::addLane
void addLane(const SUMOSAXAttributes &attrs)
Parses a lane and modifies myCurrentEdge according to the given attribures.
Definition: NIXMLEdgesHandler.cpp:330
NIXMLEdgesHandler::myToNode
NBNode * myToNode
Definition: NIXMLEdgesHandler.h:166
NIXMLEdgesHandler::setNodes
bool setNodes(const SUMOSAXAttributes &attrs)
Sets from/to node information of the currently parsed edge.
Definition: NIXMLEdgesHandler.cpp:467
NIXMLEdgesHandler::mySplits
std::vector< NBEdgeCont::Split > mySplits
The list of this edge's splits.
Definition: NIXMLEdgesHandler.h:224
NIXMLEdgesHandler::myCurrentWidth
double myCurrentWidth
The current edge's lane width.
Definition: NIXMLEdgesHandler.h:154
NIXMLEdgesHandler::myLanesSpread
LaneSpreadFunction myLanesSpread
Information about how to spread the lanes.
Definition: NIXMLEdgesHandler.h:175
NIXMLEdgesHandler::myPermissions
SVCPermissions myPermissions
Information about lane permissions.
Definition: NIXMLEdgesHandler.h:178
NIXMLEdgesHandler::deleteEdge
void deleteEdge(const SUMOSAXAttributes &attrs)
parses delete tag and deletes the specified edge or lane
Definition: NIXMLEdgesHandler.cpp:538
NBTypeCont
A storage for available types of edges.
Definition: NBTypeCont.h:54
NIXMLEdgesHandler::myKeepEdgeShape
const bool myKeepEdgeShape
Whether the edge shape shall be kept generally.
Definition: NIXMLEdgesHandler.h:256
NIXMLEdgesHandler::myStartElement
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
Definition: NIXMLEdgesHandler.cpp:81
NIXMLEdgesHandler::myCurrentLaneIndex
int myCurrentLaneIndex
The currently processed lane index.
Definition: NIXMLEdgesHandler.h:221
NIXMLEdgesHandler::myHaveReportedAboutTypeOverride
bool myHaveReportedAboutTypeOverride
Information whether at least one edge's type was changed.
Definition: NIXMLEdgesHandler.h:251
LaneSpreadFunction
LaneSpreadFunction
Numbers representing special SUMO-XML-attribute values Information how the edge's lateral offset shal...
Definition: SUMOXMLDefinitions.h:1097
NIXMLEdgesHandler::myCurrentStreetName
std::string myCurrentStreetName
The current edge's street name.
Definition: NIXMLEdgesHandler.h:160
config.h
NIXMLEdgesHandler::addRoundabout
void addRoundabout(const SUMOSAXAttributes &attrs)
Parses a roundabout and stores it in myEdgeCont.
Definition: NIXMLEdgesHandler.cpp:604
NBNode
Represents a single node (junction) during network building.
Definition: NBNode.h:67
SUMOSAXAttributes
Encapsulated SAX-Attributes.
Definition: SUMOSAXAttributes.h:56
NBEdgeCont::Split
A structure which describes changes of lane number or speed along the road.
Definition: NBEdgeCont.h:205
NIXMLEdgesHandler::myCurrentLaneNo
int myCurrentLaneNo
The current edge's number of lanes.
Definition: NIXMLEdgesHandler.h:151
NIXMLEdgesHandler::tryGetShape
PositionVector tryGetShape(const SUMOSAXAttributes &attrs)
Tries to parse the shape definition.
Definition: NIXMLEdgesHandler.cpp:503
PositionVector.h
NIXMLEdgesHandler::myCurrentPriority
int myCurrentPriority
The current edge's priority.
Definition: NIXMLEdgesHandler.h:148
NIXMLEdgesHandler::tryGetLaneSpread
LaneSpreadFunction tryGetLaneSpread(const SUMOSAXAttributes &attrs)
Tries to parse the spread type.
Definition: NIXMLEdgesHandler.cpp:523
NBEdge.h
NIXMLEdgesHandler::myCurrentID
std::string myCurrentID
The current edge's id.
Definition: NIXMLEdgesHandler.h:142