SUMO - Simulation of Urban MObility
NIXMLTrafficLightsHandler.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 /****************************************************************************/
17 // Importer for traffic lights stored in XML
18 /****************************************************************************/
19 #ifndef NIXMLTrafficLightsHandler_h
20 #define NIXMLTrafficLightsHandler_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
33 #include <netbuild/NBConnection.h>
34 
35 
36 // ===========================================================================
37 // class declarations
38 // ===========================================================================
39 class NBEdge;
40 class NBEdgeCont;
41 class MsgHandler;
42 class NBLoadedSUMOTLDef;
44 
45 
46 // ===========================================================================
47 // class definitions
48 // ===========================================================================
57 public:
62 
63 
66 
67 
68 protected:
70 
71 
79  void myStartElement(int element, const SUMOSAXAttributes& attrs);
80 
81 
88  void myEndElement(int element);
90 
91 
92 
93 private:
96 
99 
102 
105 
111 
113  void addTlConnection(const SUMOSAXAttributes& attrs);
114 
116  void removeTlConnection(const SUMOSAXAttributes& attrs);
117 
119  NBEdge* retrieveEdge(const SUMOSAXAttributes& attrs, SumoXMLAttr attr, bool& ok);
120 
122  int retrieveLaneIndex(const SUMOSAXAttributes& attrs, SumoXMLAttr attr, NBEdge* edge, bool& ok);
123 
124 
125 
126 private:
129 
132 
133 
134 };
135 
136 
137 #endif
138 
139 /****************************************************************************/
140 
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
A loaded (complete) traffic light logic.
NBEdgeCont & myEdgeCont
The edge container for retrieving edges.
A container for traffic light definitions and built programs.
NBEdge * retrieveEdge(const SUMOSAXAttributes &attrs, SumoXMLAttr attr, bool &ok)
parses and edge id an returns an existing edge
The representation of a single edge during network building.
Definition: NBEdge.h:70
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
NBLoadedSUMOTLDef * initTrafficLightLogic(const SUMOSAXAttributes &attrs, NBLoadedSUMOTLDef *currentTL)
SAX-handler base for SUMO-files.
NBTrafficLightLogicCont & myTLLCont
The traffic light container to fill.
int retrieveLaneIndex(const SUMOSAXAttributes &attrs, SumoXMLAttr attr, NBEdge *edge, bool &ok)
parses a lane index and verifies its correctness
Encapsulated SAX-Attributes.
void addTlConnection(const SUMOSAXAttributes &attrs)
reads and adds tl-controlled connection
NBLoadedSUMOTLDef * myCurrentTL
The currently parsed traffic light.
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:66
void removeTlConnection(const SUMOSAXAttributes &attrs)
reads and removes tl-controlled connection
bool myResetPhases
whether phases of a previously loaded traffic light must be reset
void myEndElement(int element)
Called when a closing tag occurs.
NIXMLTrafficLightsHandler(NBTrafficLightLogicCont &tlCont, NBEdgeCont &ec)
Constructor.
Importer for edge connections stored in XML.
NIXMLTrafficLightsHandler & operator=(const NIXMLTrafficLightsHandler &s)
invalidated assignment operator