SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NIXMLTrafficLightsHandler.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // Importer for traffic lights stored in XML
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
10 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 #ifndef NIXMLTrafficLightsHandler_h
21 #define NIXMLTrafficLightsHandler_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
34 #include <netbuild/NBConnection.h>
35 
36 
37 // ===========================================================================
38 // class declarations
39 // ===========================================================================
40 class NBEdge;
41 class NBEdgeCont;
42 class MsgHandler;
43 class NBLoadedSUMOTLDef;
45 
46 
47 // ===========================================================================
48 // class definitions
49 // ===========================================================================
58 public:
63 
64 
67 
68 
69 protected:
71 
72 
80  void myStartElement(int element, const SUMOSAXAttributes& attrs);
81 
82 
89  void myEndElement(int element);
91 
92 
93 
94 private:
97 
100 
103 
106 
112 
114  void addTlConnection(const SUMOSAXAttributes& attrs);
115 
117  void removeTlConnection(const SUMOSAXAttributes& attrs);
118 
120  NBEdge* retrieveEdge(const SUMOSAXAttributes& attrs, SumoXMLAttr attr, bool& ok);
121 
123  int retrieveLaneIndex(const SUMOSAXAttributes& attrs, SumoXMLAttr attr, NBEdge* edge, bool& ok);
124 
125 
126 
127 private:
130 
133 
134 
135 };
136 
137 
138 #endif
139 
140 /****************************************************************************/
141 
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:71
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