Eclipse 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-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 /****************************************************************************/
16 // Importer for edge connections stored in XML
17 /****************************************************************************/
18 #ifndef NIXMLConnectionsHandler_h
19 #define NIXMLConnectionsHandler_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
28 #include <netbuild/NBConnection.h>
29 
30 
31 // ===========================================================================
32 // class declarations
33 // ===========================================================================
34 class NBEdge;
35 class NBEdgeCont;
36 class NBNodeCont;
38 class MsgHandler;
39 
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
52 public:
57 
58 
61 
62 
63 protected:
65 
66 
74  void myStartElement(int element,
75  const SUMOSAXAttributes& attrs);
77 
78 private:
87  NBConnection parseConnection(const std::string& defRole, const std::string& def);
88 
89 
95  void parseLaneBound(const SUMOSAXAttributes& attrs, NBEdge* from, NBEdge* to);
96 
97 
105  bool parseLaneInfo(const SUMOSAXAttributes& attributes, NBEdge* fromEdge, NBEdge* toEdge, int* fromLane, int* toLane);
106 
107 
115  inline bool parseDeprecatedLaneDefinition(const SUMOSAXAttributes& attributes,
116  NBEdge* fromEdge, NBEdge* toEdge,
117  int* fromLane, int* toLane);
118 
119 
125  inline bool parseLaneDefinition(const SUMOSAXAttributes& attributes, int* fromLane, int* toLane);
126 
127 
131  void addCrossing(const SUMOSAXAttributes& attrs);
132 
136  void addWalkingArea(const SUMOSAXAttributes& attrs);
137 
138 private:
141 
144 
148 
151 
154 
155 private:
158 
161 
162 
163 };
164 
165 
166 #endif
167 
168 /****************************************************************************/
169 
NIXMLConnectionsHandler::parseConnection
NBConnection parseConnection(const std::string &defRole, const std::string &def)
Returns the connection described by def.
Definition: NIXMLConnectionsHandler.cpp:163
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
NBTrafficLightLogicCont
A container for traffic light definitions and built programs.
Definition: NBTrafficLightLogicCont.h:57
NIXMLConnectionsHandler::myStartElement
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
Definition: NIXMLConnectionsHandler.cpp:66
NBConnection.h
NIXMLConnectionsHandler::addCrossing
void addCrossing(const SUMOSAXAttributes &attrs)
Parses a crossing and updates the referenced node.
Definition: NIXMLConnectionsHandler.cpp:323
SUMOSAXHandler.h
NIXMLConnectionsHandler
Importer for edge connections stored in XML.
Definition: NIXMLConnectionsHandler.h:51
NIXMLConnectionsHandler::parseDeprecatedLaneDefinition
bool parseDeprecatedLaneDefinition(const SUMOSAXAttributes &attributes, NBEdge *fromEdge, NBEdge *toEdge, int *fromLane, int *toLane)
Parses information about lane-2-lane connection in deprecated format.
Definition: NIXMLConnectionsHandler.cpp:285
NIXMLConnectionsHandler::myEdgeCont
NBEdgeCont & myEdgeCont
The edge container to fill.
Definition: NIXMLConnectionsHandler.h:140
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
NIXMLConnectionsHandler::addWalkingArea
void addWalkingArea(const SUMOSAXAttributes &attrs)
Parses a walkingArea and updates the referenced node.
Definition: NIXMLConnectionsHandler.cpp:415
NIXMLConnectionsHandler::parseLaneInfo
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.
Definition: NIXMLConnectionsHandler.cpp:274
MsgHandler
Definition: MsgHandler.h:38
NIXMLConnectionsHandler::parseLaneBound
void parseLaneBound(const SUMOSAXAttributes &attrs, NBEdge *from, NBEdge *to)
Parses a connection when it describes a lane-2-lane relationship.
Definition: NIXMLConnectionsHandler.cpp:198
NIXMLConnectionsHandler::myNodeCont
NBNodeCont & myNodeCont
The edge container to fill.
Definition: NIXMLConnectionsHandler.h:143
NBConnection
Definition: NBConnection.h:43
NIXMLConnectionsHandler::operator=
NIXMLConnectionsHandler & operator=(const NIXMLConnectionsHandler &s)
invalidated assignment operator
NIXMLConnectionsHandler::NIXMLConnectionsHandler
NIXMLConnectionsHandler(NBEdgeCont &ec, NBNodeCont &nc, NBTrafficLightLogicCont &tlc)
Constructor.
Definition: NIXMLConnectionsHandler.cpp:52
NIXMLConnectionsHandler::~NIXMLConnectionsHandler
~NIXMLConnectionsHandler()
Destructor.
Definition: NIXMLConnectionsHandler.cpp:62
NIXMLConnectionsHandler::myTLLogicCont
NBTrafficLightLogicCont & myTLLogicCont
The traffic lights container to add built tls to (when invalidating tls)
Definition: NIXMLConnectionsHandler.h:147
config.h
NIXMLConnectionsHandler::myErrorMsgHandler
MsgHandler *const myErrorMsgHandler
the handler for loading errors
Definition: NIXMLConnectionsHandler.h:153
NIXMLConnectionsHandler::myHaveWarnedAboutDeprecatedLanes
bool myHaveWarnedAboutDeprecatedLanes
Information whether we have a deprecated attribute.
Definition: NIXMLConnectionsHandler.h:150
NIXMLConnectionsHandler::parseLaneDefinition
bool parseLaneDefinition(const SUMOSAXAttributes &attributes, int *fromLane, int *toLane)
Parses information about lane-2-lane connection.
Definition: NIXMLConnectionsHandler.cpp:312
SUMOSAXAttributes
Encapsulated SAX-Attributes.
Definition: SUMOSAXAttributes.h:56
NIXMLConnectionsHandler::NIXMLConnectionsHandler
NIXMLConnectionsHandler(const NIXMLConnectionsHandler &s)
invalidated copy constructor