SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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-sim.org/
12 // Copyright (C) 2012-2014 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 #ifdef HAVE_INTERNAL
43 class MESegment;
44 #endif
45 
46 
47 // ===========================================================================
48 // class definitions
49 // ===========================================================================
55 public:
57  MSStateHandler(const std::string& file, const SUMOTime offset);
58 
60  virtual ~MSStateHandler();
61 
66  static void saveState(const std::string& file, SUMOTime step);
67 
68  SUMOTime getTime() const {
69  return myTime;
70  }
71 
72 protected:
74 
75 
83  void myStartElement(int element,
84  const SUMOSAXAttributes& attrs);
85 
86 
93  void myEndElement(int element);
95 
96 
97 private:
100 #ifdef HAVE_INTERNAL
101  MESegment* mySegment;
102 #endif
103  std::pair<int, int> myEdgeAndLane;
104  unsigned int myQueIndex;
105 
108 
109 private:
111  MSStateHandler(const MSStateHandler& s);
112 
115 
116 };
117 
118 
119 #endif
120 
121 /****************************************************************************/
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
unsigned int myQueIndex
Parser and output filter for routes and vehicles state saving and loading.
Structure representing possible vehicle parameter.
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
void myEndElement(int element)
Called when a closing tag occurs.
static void saveState(const std::string &file, SUMOTime step)
Saves the current state.