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 #include "ROAbstractRouteDefLoader.h"
00039 
00040 
00041 // ===========================================================================
00042 // class declarations
00043 // ===========================================================================
00044 class RONet;
00045 class Options;
00046 
00047 
00048 // ===========================================================================
00049 // class definitions
00050 // ===========================================================================
00061 class ROTypedXMLRoutesLoader : public ROAbstractRouteDefLoader,
00062     public SUMOSAXHandler {
00063 public:
00073     ROTypedXMLRoutesLoader(RONet& net,
00074                            SUMOTime begin, SUMOTime end, const std::string& file = "") ;
00075 
00076 
00078     virtual ~ROTypedXMLRoutesLoader() ;
00079 
00080 
00082 
00083 
00092     bool readRoutesAtLeastUntil(SUMOTime time, bool skipping) ;
00093 
00094 
00099     bool ended() const {
00100         return myEnded;
00101     }
00103 
00104 
00109     void endDocument();
00110 
00111 
00112 
00113 protected:
00116 
00122     virtual bool nextRouteRead() = 0;
00123 
00124 
00129     virtual void beginNextRoute() = 0;
00131 
00132 
00133 protected:
00135     SAX2XMLReader* myParser;
00136 
00138     XMLPScanToken myToken;
00139 
00141     bool myEnded;
00142 
00143 
00144 private:
00146     ROTypedXMLRoutesLoader(const ROTypedXMLRoutesLoader& src);
00147 
00149     ROTypedXMLRoutesLoader& operator=(const ROTypedXMLRoutesLoader& src);
00150 
00151 };
00152 
00153 
00154 #endif
00155 
00156 /****************************************************************************/
00157 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines