SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SUMOSAXAttributesImpl_Binary.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // Encapsulated Xerces-SAX-attributes
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
12 // Copyright (C) 2001-2012 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 SUMOSAXAttributesImpl_Binary_h
23 #define SUMOSAXAttributesImpl_Binary_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 <map>
36 #include <set>
37 #include "SUMOSAXAttributes.h"
38 
39 
40 // ===========================================================================
41 // class declarations
42 // ===========================================================================
43 class BinaryInputDevice;
44 
45 
46 // ===========================================================================
47 // class definitions
48 // ===========================================================================
56 public:
63  SUMOSAXAttributesImpl_Binary(const std::map<int, std::string>& predefinedTagsMML,
64  const std::string& objectType,
65  BinaryInputDevice* in);
66 
67 
70 
71 
72 
73 
76 
82  bool hasAttribute(int id) const;
83 
84 
100  bool getBool(int id) const throw(EmptyData, BoolFormatException);
101 
116  bool getBoolSecure(int id, bool def) const throw(EmptyData);
117 
118 
134  int getInt(int id) const;
135 
153  int getIntSecure(int id, int def) const;
154 
155 
171  SUMOLong getLong(int id) const;
172 
173 
186  std::string getString(int id) const throw(EmptyData);
187 
200  std::string getStringSecure(int id,
201  const std::string& def) const throw(EmptyData);
202 
203 
219  SUMOReal getFloat(int id) const;
220 
238  SUMOReal getFloatSecure(int id, SUMOReal def) const;
239 
240 
244  bool hasAttribute(const std::string& id) const;
245 
246 
262  SUMOReal getFloat(const std::string& id) const;
263 
264 
274  std::string getStringSecure(const std::string& id,
275  const std::string& def) const;
276  //}
277 
278 
285  SumoXMLEdgeFunc getEdgeFunc(bool& ok) const;
286 
287 
294  SumoXMLNodeType getNodeType(bool& ok) const;
295 
296 
303  RGBColor getColorReporting(const char* objectid, bool& ok) const;
304 
305 
319  PositionVector getShapeReporting(int attr, const char* objectid, bool& ok,
320  bool allowEmpty) const;
321 
335  Boundary getBoundaryReporting(int attr, const char* objectid, bool& ok) const;
336 
337 
345  std::string getName(int attr) const;
346 
347 
352  void serialize(std::ostream& os) const;
353 
354 
355 private:
357  const std::map<int, std::string>& myAttrIds;
358 
360  std::set<int> myAttrs;
361 
363  std::map<int, char> myCharValues;
364 
366  std::map<int, int> myIntValues;
367 
369  std::map<int, SUMOReal> myFloatValues;
370 
372  std::map<int, std::string> myStringValues;
373 
375  std::map<int, PositionVector> myPositionVectors;
376 
377 
378 private:
381 
384 
385 
386 };
387 
388 
389 #endif
390 
391 /****************************************************************************/
392