SUMO - Simulation of Urban MObility
ODDistrictHandler.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 /****************************************************************************/
19 // An XML-Handler for districts
20 /****************************************************************************/
21 #ifndef ODDistrictHandler_h
22 #define ODDistrictHandler_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <string>
35 #include <utility>
37 
38 
39 // ===========================================================================
40 // class declarations
41 // ===========================================================================
42 class ODDistrict;
43 class ODDistrictCont;
44 
45 
46 // ===========================================================================
47 // class definitions
48 // ===========================================================================
57 public:
64  ODDistrictHandler(ODDistrictCont& cont, const std::string& file);
65 
66 
69 
70 
71 protected:
73 
74 
85  void myStartElement(int element,
86  const SUMOSAXAttributes& attrs);
87 
88 
96  void myEndElement(int element);
98 
99 
100 private:
109  void openDistrict(const SUMOSAXAttributes& attrs);
110 
111 
123  void addSource(const SUMOSAXAttributes& attrs);
124 
125 
137  void addSink(const SUMOSAXAttributes& attrs);
138 
139 
144  void closeDistrict();
145 
146 
162  std::pair<std::string, double> parseTAZ(const SUMOSAXAttributes& attrs);
163 
164 private:
167 
170 
171 
172 private:
175 
178 
179 
180 };
181 
182 
183 #endif
184 
185 /****************************************************************************/
186 
~ODDistrictHandler()
Destructor.
void addSource(const SUMOSAXAttributes &attrs)
Adds a read source to the current district.
An XML-Handler for districts.
std::pair< std::string, double > parseTAZ(const SUMOSAXAttributes &attrs)
Returns the id and weight for a taz/tazSink/tazSource.
SAX-handler base for SUMO-files.
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called when an opening-tag occurs.
ODDistrictHandler & operator=(const ODDistrictHandler &s)
invalidated assignment operator
Encapsulated SAX-Attributes.
void myEndElement(int element)
Called when a closing tag occurs.
A container for districts.
void addSink(const SUMOSAXAttributes &attrs)
Adds a read sink to the current district.
ODDistrictHandler(ODDistrictCont &cont, const std::string &file)
Constructor.
void closeDistrict()
Closes the processing of the current district.
void openDistrict(const SUMOSAXAttributes &attrs)
Begins the parsing of a district.
ODDistrict * myCurrentDistrict
The currently parsed district.
ODDistrictCont & myContainer
The container to add read districts to.
A district (origin/destination)
Definition: ODDistrict.h:51