SUMO - Simulation of Urban MObility
ROTypedXMLRoutesLoader.h
Go to the documentation of this file.
00001 /****************************************************************************/
00008 // Base class for loading routes from XML-files
00009 /****************************************************************************/
00010 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00011 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
00012 /****************************************************************************/
00013 //
00014 //   This file is part of SUMO.
00015 //   SUMO is free software: you can redistribute it and/or modify
00016 //   it under the terms of the GNU General Public License as published by
00017 //   the Free Software Foundation, either version 3 of the License, or
00018 //   (at your option) any later version.
00019 //
00020 /****************************************************************************/
00021 #ifndef ROTypedXMLRoutesLoader_h
00022 #define ROTypedXMLRoutesLoader_h
00023 
00024 
00025 // ===========================================================================
00026 // included modules
00027 // ===========================================================================
00028 #ifdef _MSC_VER
00029 #include <windows_config.h>
00030 #else
00031 #include <config.h>
00032 #endif
00033 
00034 #include <string>
00035 #include <xercesc/sax2/SAX2XMLReader.hpp>
00036 #include <xercesc/framework/XMLPScanToken.hpp>
00037 #include <utils/xml/SUMOSAXHandler.h>
00038 
00039 
00040 // ===========================================================================
00041 // class declarations
00042 // ===========================================================================
00043 class RONet;
00044 class Options;
00045 
00046 
00047 // ===========================================================================
00048 // class definitions
00049 // ===========================================================================
00060 class ROTypedXMLRoutesLoader : public SUMOSAXHandler {
00061 public:
00071     ROTypedXMLRoutesLoader(RONet& net,
00072                            SUMOTime begin, SUMOTime end, const std::string& file = "") ;
00073 
00074 
00076     virtual ~ROTypedXMLRoutesLoader() ;
00077 
00078 
00086     virtual bool readRoutesAtLeastUntil(SUMOTime time);
00087 
00088 
00093     SUMOTime getLastReadTimeStep() const {
00094         return myCurrentDepart;
00095     }
00096 
00097 
00102     bool ended() const {
00103         return myEnded;
00104     }
00105 
00106 
00111     void endDocument();
00112 
00113 
00114 protected:
00116     RONet& myNet;
00117 
00119     SUMOTime myBegin;
00120 
00122     SUMOTime myEnd;
00123 
00125     SAX2XMLReader* myParser;
00126 
00128     XMLPScanToken myToken;
00129 
00131     SUMOTime myCurrentDepart;
00132 
00134     bool myNextRouteRead;
00135 
00137     bool myEnded;
00138 
00139 
00140 private:
00142     ROTypedXMLRoutesLoader(const ROTypedXMLRoutesLoader& src);
00143 
00145     ROTypedXMLRoutesLoader& operator=(const ROTypedXMLRoutesLoader& src);
00146 
00147 };
00148 
00149 
00150 #endif
00151 
00152 /****************************************************************************/
00153 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines