SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SAXWeightsHandler.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // An XML-handler for network weights
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 SAXWeightsHandler_h
23 #define SAXWeightsHandler_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>
37 #include <utils/common/SUMOTime.h>
38 
39 
40 // ===========================================================================
41 // class declarations
42 // ===========================================================================
43 class OptionsCont;
44 class RONet;
45 class ROEdge;
46 
47 
48 // ===========================================================================
49 // class definitions
50 // ===========================================================================
77 public:
83  public:
86 
89 
97  virtual void addEdgeWeight(const std::string& id,
98  SUMOReal val, SUMOReal beg, SUMOReal end) const = 0;
99 
100  private:
101  EdgeFloatTimeLineRetriever& operator=(const EdgeFloatTimeLineRetriever&); // just to avoid a compiler warning
102  };
103 
109  public:
111  ToRetrieveDefinition(const std::string& attributeName, bool edgeBased,
112  EdgeFloatTimeLineRetriever& destination);
113 
116 
117  public:
119  std::string myAttributeName;
120 
123 
126 
129 
131  size_t myNoLanes;
132 
135 
136  private:
139 
142 
143  };
144 
151  SAXWeightsHandler(const std::vector<ToRetrieveDefinition*>& defs,
152  const std::string& file);
153 
154 
161  const std::string& file);
162 
163 
166 
167 
168 protected:
170 
171 
179  void myStartElement(int element,
180  const SUMOSAXAttributes& attrs);
181 
182 
189  void myEndElement(int elemente);
191 
192 
193 private:
195  void tryParse(const SUMOSAXAttributes& attrs, bool isEdge);
196 
197 
198 private:
200  std::vector<ToRetrieveDefinition*> myDefinitions;
201 
204 
207 
209  std::string myCurrentEdgeID;
210 
211 
212 private:
215 
218 
219 };
220 
221 
222 #endif
223 
224 /****************************************************************************/
225