SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
NIXMLConnectionsHandler.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // Importer for edge connections stored in XML
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef NIXMLConnectionsHandler_h
23 #define NIXMLConnectionsHandler_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
36 #include <netbuild/NBConnection.h>
37 
38 
39 // ===========================================================================
40 // class declarations
41 // ===========================================================================
42 class NBEdge;
43 class NBEdgeCont;
44 class NBNodeCont;
46 class MsgHandler;
47 
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
60 public:
65 
66 
69 
70 
71 protected:
73 
74 
82  void myStartElement(int element,
83  const SUMOSAXAttributes& attrs);
85 
86 private:
95  NBConnection parseConnection(const std::string& defRole, const std::string& def);
96 
97 
103  void parseLaneBound(const SUMOSAXAttributes& attrs, NBEdge* from, NBEdge* to);
104 
105 
113  bool parseLaneInfo(const SUMOSAXAttributes& attributes, NBEdge* fromEdge, NBEdge* toEdge, int* fromLane, int* toLane);
114 
115 
123  inline bool parseDeprecatedLaneDefinition(const SUMOSAXAttributes& attributes,
124  NBEdge* fromEdge, NBEdge* toEdge,
125  int* fromLane, int* toLane);
126 
127 
133  inline bool parseLaneDefinition(const SUMOSAXAttributes& attributes, int* fromLane, int* toLane);
134 
135 
139  void addCrossing(const SUMOSAXAttributes& attrs);
140 
144  void addCustomShape(const SUMOSAXAttributes& attrs);
145 
146 private:
149 
152 
156 
159 
162 
163 private:
166 
169 
170 
171 };
172 
173 
174 #endif
175 
176 /****************************************************************************/
177 
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:71
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.
void addCustomShape(const SUMOSAXAttributes &attrs)
Parses a customShape and updates the referenced node.
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.
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:64
NBTrafficLightLogicCont & myTLLogicCont
The traffic lights container to add built tls to (when invalidating tls)