SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MSStateHandler.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // Parser and output filter for routes and vehicles state saving and loading
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2012-2016 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 MSStateHandler_h
23 #define MSStateHandler_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 <utils/common/SUMOTime.h>
37 
38 
39 // ===========================================================================
40 // class declarations
41 // ===========================================================================
42 class MESegment;
43 
44 
45 // ===========================================================================
46 // class definitions
47 // ===========================================================================
53 public:
55  MSStateHandler(const std::string& file, const SUMOTime offset);
56 
58  virtual ~MSStateHandler();
59 
64  static void saveState(const std::string& file, SUMOTime step);
65 
66  SUMOTime getTime() const {
67  return myTime;
68  }
69 
70 protected:
72 
73 
81  void myStartElement(int element,
82  const SUMOSAXAttributes& attrs);
83 
84 
91  void myEndElement(int element);
93 
94 
95 private:
99  std::pair<int, int> myEdgeAndLane;
101 
104 
105 private:
107  MSStateHandler(const MSStateHandler& s);
108 
111 
112 };
113 
114 
115 #endif
116 
117 /****************************************************************************/
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
long long int SUMOTime
Definition: SUMOTime.h:43
Parser and output filter for routes and vehicles state saving and loading.
Structure representing possible vehicle parameter.
MESegment * mySegment
std::pair< int, int > myEdgeAndLane
SAX-handler base for SUMO-files.
SUMOVTypeParameter * myCurrentVType
The currently parsed vehicle type.
MSStateHandler(const std::string &file, const SUMOTime offset)
standard constructor
Encapsulated SAX-Attributes.
MSStateHandler & operator=(const MSStateHandler &s)
Invalidated assignment operator.
const SUMOTime myOffset
SUMOTime getTime() const
virtual ~MSStateHandler()
standard destructor
A single mesoscopic segment (cell)
Definition: MESegment.h:57
void myEndElement(int element)
Called when a closing tag occurs.
static void saveState(const std::string &file, SUMOTime step)
Saves the current state.