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 /****************************************************************************/
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 
NIXMLConnectionsHandler::parseConnection
NBConnection parseConnection(const std::string &defRole, const std::string &def)
Returns the connection described by def.
Definition: NIXMLConnectionsHandler.cpp:164
NBEdgeCont
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:61
SUMOSAXHandler
SAX-handler base for SUMO-files.
Definition: SUMOSAXHandler.h:42
NBTrafficLightLogicCont
A container for traffic light definitions and built programs.
Definition: NBTrafficLightLogicCont.h:58
NIXMLConnectionsHandler::myStartElement
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
Definition: NIXMLConnectionsHandler.cpp:67
NBConnection.h
NIXMLConnectionsHandler::addCrossing
void addCrossing(const SUMOSAXAttributes &attrs)
Parses a crossing and updates the referenced node.
Definition: NIXMLConnectionsHandler.cpp:317
SUMOSAXHandler.h
NIXMLConnectionsHandler
Importer for edge connections stored in XML.
Definition: NIXMLConnectionsHandler.h:52
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:279
NIXMLConnectionsHandler::myEdgeCont
NBEdgeCont & myEdgeCont
The edge container to fill.
Definition: NIXMLConnectionsHandler.h:141
NBNodeCont
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:60
NBEdge
The representation of a single edge during network building.
Definition: NBEdge.h:86
NIXMLConnectionsHandler::addWalkingArea
void addWalkingArea(const SUMOSAXAttributes &attrs)
Parses a walkingArea and updates the referenced node.
Definition: NIXMLConnectionsHandler.cpp:409
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:268
MsgHandler
Definition: MsgHandler.h:44
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:199
NIXMLConnectionsHandler::myNodeCont
NBNodeCont & myNodeCont
The edge container to fill.
Definition: NIXMLConnectionsHandler.h:144
NBConnection
Definition: NBConnection.h:44
NIXMLConnectionsHandler::operator=
NIXMLConnectionsHandler & operator=(const NIXMLConnectionsHandler &s)
invalidated assignment operator
NIXMLConnectionsHandler::NIXMLConnectionsHandler
NIXMLConnectionsHandler(NBEdgeCont &ec, NBNodeCont &nc, NBTrafficLightLogicCont &tlc)
Constructor.
Definition: NIXMLConnectionsHandler.cpp:53
NIXMLConnectionsHandler::~NIXMLConnectionsHandler
~NIXMLConnectionsHandler()
Destructor.
Definition: NIXMLConnectionsHandler.cpp:63
NIXMLConnectionsHandler::myTLLogicCont
NBTrafficLightLogicCont & myTLLogicCont
The traffic lights container to add built tls to (when invalidating tls)
Definition: NIXMLConnectionsHandler.h:148
config.h
NIXMLConnectionsHandler::myErrorMsgHandler
MsgHandler *const myErrorMsgHandler
the handler for loading errors
Definition: NIXMLConnectionsHandler.h:154
NIXMLConnectionsHandler::myHaveWarnedAboutDeprecatedLanes
bool myHaveWarnedAboutDeprecatedLanes
Information whether we have a deprecated attribute.
Definition: NIXMLConnectionsHandler.h:151
NIXMLConnectionsHandler::parseLaneDefinition
bool parseLaneDefinition(const SUMOSAXAttributes &attributes, int *fromLane, int *toLane)
Parses information about lane-2-lane connection.
Definition: NIXMLConnectionsHandler.cpp:306
SUMOSAXAttributes
Encapsulated SAX-Attributes.
Definition: SUMOSAXAttributes.h:57