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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
19 // Importer for edge connections stored in XML
20 /****************************************************************************/
21 #ifndef NIXMLConnectionsHandler_h
22 #define NIXMLConnectionsHandler_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
35 #include <netbuild/NBConnection.h>
36 
37 
38 // ===========================================================================
39 // class declarations
40 // ===========================================================================
41 class NBEdge;
42 class NBEdgeCont;
43 class NBNodeCont;
45 class MsgHandler;
46 
47 
48 // ===========================================================================
49 // class definitions
50 // ===========================================================================
59 public:
64 
65 
68 
69 
70 protected:
72 
73 
81  void myStartElement(int element,
82  const SUMOSAXAttributes& attrs);
84 
85 private:
94  NBConnection parseConnection(const std::string& defRole, const std::string& def);
95 
96 
102  void parseLaneBound(const SUMOSAXAttributes& attrs, NBEdge* from, NBEdge* to);
103 
104 
112  bool parseLaneInfo(const SUMOSAXAttributes& attributes, NBEdge* fromEdge, NBEdge* toEdge, int* fromLane, int* toLane);
113 
114 
122  inline bool parseDeprecatedLaneDefinition(const SUMOSAXAttributes& attributes,
123  NBEdge* fromEdge, NBEdge* toEdge,
124  int* fromLane, int* toLane);
125 
126 
132  inline bool parseLaneDefinition(const SUMOSAXAttributes& attributes, int* fromLane, int* toLane);
133 
134 
138  void addCrossing(const SUMOSAXAttributes& attrs);
139 
143  void addWalkingArea(const SUMOSAXAttributes& attrs);
144 
145 private:
148 
151 
155 
158 
161 
162 private:
165 
168 
169 
170 };
171 
172 
173 #endif
174 
175 /****************************************************************************/
176 
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:70
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:66
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:66
NBTrafficLightLogicCont & myTLLogicCont
The traffic lights container to add built tls to (when invalidating tls)