SUMO - Simulation of Urban MObility
NIXMLConnectionsHandler.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-2018 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 edge connections stored in XML
18 /****************************************************************************/
19 #ifndef NIXMLConnectionsHandler_h
20 #define NIXMLConnectionsHandler_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
29 #include <netbuild/NBConnection.h>
30 
31 
32 // ===========================================================================
33 // class declarations
34 // ===========================================================================
35 class NBEdge;
36 class NBEdgeCont;
37 class NBNodeCont;
39 class MsgHandler;
40 
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
53 public:
58 
59 
62 
63 
64 protected:
66 
67 
75  void myStartElement(int element,
76  const SUMOSAXAttributes& attrs);
78 
79 private:
88  NBConnection parseConnection(const std::string& defRole, const std::string& def);
89 
90 
96  void parseLaneBound(const SUMOSAXAttributes& attrs, NBEdge* from, NBEdge* to);
97 
98 
106  bool parseLaneInfo(const SUMOSAXAttributes& attributes, NBEdge* fromEdge, NBEdge* toEdge, int* fromLane, int* toLane);
107 
108 
116  inline bool parseDeprecatedLaneDefinition(const SUMOSAXAttributes& attributes,
117  NBEdge* fromEdge, NBEdge* toEdge,
118  int* fromLane, int* toLane);
119 
120 
126  inline bool parseLaneDefinition(const SUMOSAXAttributes& attributes, int* fromLane, int* toLane);
127 
128 
132  void addCrossing(const SUMOSAXAttributes& attrs);
133 
137  void addWalkingArea(const SUMOSAXAttributes& attrs);
138 
139 private:
142 
145 
149 
152 
155 
156 private:
159 
162 
163 
164 };
165 
166 
167 #endif
168 
169 /****************************************************************************/
170 
void addCrossing(const SUMOSAXAttributes &attrs)
Parses a crossing and updates the referenced node.
A container for traffic light definitions and built programs.
bool myHaveWarnedAboutDeprecatedLanes
Information whether we have a deprecated attribute.
bool parseLaneInfo(const SUMOSAXAttributes &attributes, NBEdge *fromEdge, NBEdge *toEdge, int *fromLane, int *toLane)
Parses information about lane-2-lane connection when it describes a lane-2-lane relationship.
Importer for edge connections stored in XML.
The representation of a single edge during network building.
Definition: NBEdge.h:65
void parseLaneBound(const SUMOSAXAttributes &attrs, NBEdge *from, NBEdge *to)
Parses a connection when it describes a lane-2-lane relationship.
SAX-handler base for SUMO-files.
bool parseLaneDefinition(const SUMOSAXAttributes &attributes, int *fromLane, int *toLane)
Parses information about lane-2-lane connection.
NBEdgeCont & myEdgeCont
The edge container to fill.
bool parseDeprecatedLaneDefinition(const SUMOSAXAttributes &attributes, NBEdge *fromEdge, NBEdge *toEdge, int *fromLane, int *toLane)
Parses information about lane-2-lane connection in deprecated format.
NBConnection parseConnection(const std::string &defRole, const std::string &def)
Returns the connection described by def.
Encapsulated SAX-Attributes.
NIXMLConnectionsHandler & operator=(const NIXMLConnectionsHandler &s)
invalidated assignment operator
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
NBNodeCont & myNodeCont
The edge container to fill.
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:61
MsgHandler *const myErrorMsgHandler
the handler for loading errors
NIXMLConnectionsHandler(NBEdgeCont &ec, NBNodeCont &nc, NBTrafficLightLogicCont &tlc)
Constructor.
void addWalkingArea(const SUMOSAXAttributes &attrs)
Parses a walkingArea and updates the referenced node.
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:60
NBTrafficLightLogicCont & myTLLogicCont
The traffic lights container to add built tls to (when invalidating tls)