|
SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00007 // The basic class for loading trip definitions 00008 /****************************************************************************/ 00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00010 // Copyright (C) 2001-2011 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(int element, 00086 const SUMOSAXAttributes& attrs) throw(ProcessError); 00087 00088 00095 void myEndElement(int 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 00130 protected: 00132 IDSupplier myIdSupplier; 00133 00135 ROEdge* myBeginEdge; 00136 00138 ROEdge* myEndEdge; 00139 00143 const bool myEmptyDestinationsAllowed; 00144 00146 const bool myWithTaz; 00147 00149 bool myNextRouteRead; 00150 00152 SUMOVTypeParameter* myCurrentVehicleType; 00153 00154 SUMOVehicleParameter* myParameter; 00155 SUMOTime myDepartureTime; 00156 00157 bool myHaveWarnedAboutDeprecatedTripDef; 00158 00159 private: 00161 RORDLoader_TripDefs(const RORDLoader_TripDefs& src); 00162 00164 RORDLoader_TripDefs& operator=(const RORDLoader_TripDefs& src); 00165 00166 }; 00167 00168 00169 #endif 00170 00171 /****************************************************************************/ 00172