SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ODDistrictHandler.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // An XML-Handler for districts
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 ODDistrictHandler_h
23 #define ODDistrictHandler_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 
35 #include <string>
36 #include <utility>
38 
39 
40 // ===========================================================================
41 // class declarations
42 // ===========================================================================
43 class ODDistrict;
44 class ODDistrictCont;
45 
46 
47 // ===========================================================================
48 // class definitions
49 // ===========================================================================
58 public:
65  ODDistrictHandler(ODDistrictCont& cont, const std::string& file);
66 
67 
70 
71 
72 protected:
74 
75 
86  void myStartElement(int element,
87  const SUMOSAXAttributes& attrs);
88 
89 
97  void myEndElement(int element);
99 
100 
101 private:
110  void openDistrict(const SUMOSAXAttributes& attrs);
111 
112 
124  void addSource(const SUMOSAXAttributes& attrs);
125 
126 
138  void addSink(const SUMOSAXAttributes& attrs);
139 
140 
145  void closeDistrict();
146 
147 
163  std::pair<std::string, SUMOReal> parseTAZ(const SUMOSAXAttributes& attrs);
164 
165 private:
168 
171 
172 
173 private:
176 
179 
180 
181 };
182 
183 
184 #endif
185 
186 /****************************************************************************/
187 
~ODDistrictHandler()
Destructor.
void addSource(const SUMOSAXAttributes &attrs)
Adds a read source to the current district.
An XML-Handler for districts.
SAX-handler base for SUMO-files.
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called when an opening-tag occurs.
std::pair< std::string, SUMOReal > parseTAZ(const SUMOSAXAttributes &attrs)
Returns the id and weight for a taz/tazSink/tazSource.
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:52