RORDLoader_TripDefs.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // The basic class for loading trip definitions
00008 /****************************************************************************/
00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00010 // Copyright 2001-2010 DLR (http://www.dlr.de/) and contributors
00011 /****************************************************************************/
00012 //
00013 //   This program is free software; you can redistribute it and/or modify
00014 //   it under the terms of the GNU General Public License as published by
00015 //   the Free Software Foundation; either version 2 of the License, or
00016 //   (at your option) any later version.
00017 //
00018 /****************************************************************************/
00019 #ifndef RORDLoader_TripDefs_h
00020 #define RORDLoader_TripDefs_h
00021 
00022 
00023 // ===========================================================================
00024 // included modules
00025 // ===========================================================================
00026 #ifdef _MSC_VER
00027 #include <windows_config.h>
00028 #else
00029 #include <config.h>
00030 #endif
00031 
00032 #include <string>
00033 #include <utils/options/OptionsCont.h>
00034 #include <utils/common/IDSupplier.h>
00035 #include <utils/xml/SUMOXMLDefinitions.h>
00036 #include "ROTypedXMLRoutesLoader.h"
00037 #include "RONet.h"
00038 #include <utils/common/SUMOVehicleParameter.h>
00039 
00040 
00041 // ===========================================================================
00042 // class definitions
00043 // ===========================================================================
00050 class RORDLoader_TripDefs : public ROTypedXMLRoutesLoader {
00051 public:
00053     RORDLoader_TripDefs(RONet &net, SUMOTime begin, SUMOTime end,
00054                         bool emptyDestinationsAllowed, bool withTaz,
00055                         const std::string &file="") throw(ProcessError);
00056 
00058     ~RORDLoader_TripDefs() throw();
00059 
00060 
00062 
00063 
00068     SUMOTime getLastReadTimeStep() const throw() {
00069         return myDepartureTime;
00070     }
00072 
00073 
00074 protected:
00076 
00077 
00085     void myStartElement(SumoXMLTag element,
00086                         const SUMOSAXAttributes &attrs) throw(ProcessError);
00087 
00088 
00095     void myEndElement(SumoXMLTag element) throw(ProcessError);
00097 
00098 
00099 
00102 
00108     bool nextRouteRead() throw() {
00109         return myNextRouteRead;
00110     }
00111 
00112 
00118     void beginNextRoute() throw();
00120 
00121 
00122 protected:
00124     std::string getVehicleID(const SUMOSAXAttributes &attrs);
00125 
00127     ROEdge *getEdge(const SUMOSAXAttributes &attrs, const std::string &purpose,
00128                     SumoXMLAttr which, const std::string &id, bool emptyAllowed);
00129 
00131     SUMOTime getPeriod(const SUMOSAXAttributes &attrs, const std::string &id);
00132 
00134     int getRepetitionNumber(const SUMOSAXAttributes &attrs, const std::string &id);
00135 
00138     std::string getLane(const SUMOSAXAttributes &attrs);
00139 
00140 protected:
00142     IDSupplier myIdSupplier;
00143 
00145     ROEdge *myBeginEdge;
00146 
00148     ROEdge *myEndEdge;
00149 
00153     const bool myEmptyDestinationsAllowed;
00154 
00156     const bool myWithTaz;
00157 
00159     bool myNextRouteRead;
00160 
00162     SUMOVTypeParameter *myCurrentVehicleType;
00163 
00164     SUMOVehicleParameter *myParameter;
00165     SUMOTime myDepartureTime;
00166 
00167 private:
00169     RORDLoader_TripDefs(const RORDLoader_TripDefs &src);
00170 
00172     RORDLoader_TripDefs &operator=(const RORDLoader_TripDefs &src);
00173 
00174 };
00175 
00176 
00177 #endif
00178 
00179 /****************************************************************************/
00180 

Generated on Wed May 5 00:06:36 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6