SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NIXMLEdgesHandler.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // Importer for network edges stored in XML
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
12 // Copyright (C) 2001-2013 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 NIXMLEdgesHandler_h
23 #define NIXMLEdgesHandler_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 
38 #include <netbuild/NBEdge.h>
39 
40 
41 // ===========================================================================
42 // class declarations
43 // ===========================================================================
44 class OptionsCont;
45 class NBNode;
46 class NBEdge;
47 class NBNodeCont;
48 class NBEdgeCont;
49 class NBTypeCont;
50 class NBDistrictCont;
51 
52 
53 // ===========================================================================
54 // class definitions
55 // ===========================================================================
72 public:
81  NBTypeCont& tc, NBDistrictCont& dc, OptionsCont& options);
82 
83 
86 
87 
88 protected:
90 
91 
99  void myStartElement(int element,
100  const SUMOSAXAttributes& attrs);
101 
102 
109  void myEndElement(int element);
111 
112 
113 private:
122 
123 
127 
128 
136  bool setNodes(const SUMOSAXAttributes& attrs);
137 
138 
139 private:
142 
143 
146 
148  std::string myCurrentID;
149 
152 
155 
158 
161 
164 
166  std::string myCurrentStreetName;
167 
169  std::string myCurrentType;
170 
173 
176 
179 
182 
185 
188 
191 
193 
194 
197 
198 
201 
204 
207 
210 
214 
215 
218 
222  struct Split {
224  std::vector<int> lanes;
228  int nameid;
231  };
232 
234  std::vector<Split> mySplits;
235 
236 
240  class split_sorter {
241  public:
243  explicit split_sorter() { }
244 
246  int operator()(const Split& e1, const Split& e2) const {
247  return e1.pos < e2.pos;
248  }
249  };
250 
251 
256  public:
259  : myPosition(pos) { }
260 
262  bool operator()(const Split& e) {
263  return e.pos == myPosition;
264  }
265 
266  private:
269 
270  };
271 
272 
275 
277 
278 
279 private:
280 
284  void addEdge(const SUMOSAXAttributes& attrs);
285 
289  void deleteEdge(const SUMOSAXAttributes& attrs);
290 
295  void addLane(const SUMOSAXAttributes& attrs);
296 
301  void addSplit(const SUMOSAXAttributes& attrs);
302 
303 private:
306 
309 
310 };
311 
312 
313 #endif
314 
315 /****************************************************************************/
316