SUMO - Simulation of Urban MObility
RORDLoader_SUMOBase.h
Go to the documentation of this file.
00001 /****************************************************************************/
00009 // The base class for SUMO-native route handlers
00010 /****************************************************************************/
00011 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00012 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
00013 /****************************************************************************/
00014 //
00015 //   This file is part of SUMO.
00016 //   SUMO is free software: you can redistribute it and/or modify
00017 //   it under the terms of the GNU General Public License as published by
00018 //   the Free Software Foundation, either version 3 of the License, or
00019 //   (at your option) any later version.
00020 //
00021 /****************************************************************************/
00022 #ifndef RORDLoader_SUMOBase_h
00023 #define RORDLoader_SUMOBase_h
00024 
00025 
00026 // ===========================================================================
00027 // included modules
00028 // ===========================================================================
00029 #ifdef _MSC_VER
00030 #include <windows_config.h>
00031 #else
00032 #include <config.h>
00033 #endif
00034 
00035 #include <string>
00036 #include "ROTypedXMLRoutesLoader.h"
00037 #include <utils/xml/SUMOXMLDefinitions.h>
00038 #include <utils/common/RGBColor.h>
00039 #include <utils/common/SUMOVehicleParameter.h>
00040 
00041 
00042 // ===========================================================================
00043 // class declarations
00044 // ===========================================================================
00045 class SUMOVTypeParameter;
00046 class RORouteDef;
00047 class MsgHandler;
00048 class RORouteDef_Alternatives;
00049 class RORouteDef_Complete;
00050 class RORoute;
00051 
00052 
00053 // ===========================================================================
00054 // class definitions
00055 // ===========================================================================
00064 class RORDLoader_SUMOBase :
00065     public ROTypedXMLRoutesLoader {
00066 public:
00068     RORDLoader_SUMOBase(RONet& net,
00069                         SUMOTime begin, SUMOTime end,
00070                         const int maxRouteNumber, const bool tryRepair, const bool withTaz,
00071                         const bool keepRoutes, const bool skipRouteCalculation,
00072                         const std::string& file = "");
00073 
00075     ~RORDLoader_SUMOBase() ;
00076 
00077 
00078 protected:
00080 
00081 
00089     virtual void myStartElement(int element,
00090                                 const SUMOSAXAttributes& attrs) ;
00091 
00092 
00100     void myCharacters(int element,
00101                       const std::string& chars) ;
00102 
00103 
00110     virtual void myEndElement(int element) ;
00112 
00114     void startAlternative(const SUMOSAXAttributes& attrs);
00115 
00117     void startRoute(const SUMOSAXAttributes& attrs);
00118 
00119     bool closeVehicle() ;
00120 
00121 
00122 protected:
00124     SUMOVehicleParameter* myVehicleParameter;
00125 
00127     RGBColor* myColor;
00128 
00130     bool myCurrentIsOk;
00131 
00133     bool myAltIsValid;
00134 
00136     RORouteDef_Alternatives* myCurrentAlternatives;
00137 
00139     SUMOReal myCost;
00140 
00142     SUMOReal myProbability;
00143 
00145     int myMaxRouteNumber;
00146 
00148     bool myTryRepair;
00149 
00151     const bool myWithTaz;
00152 
00154     const bool myKeepRoutes;
00155 
00157     const bool mySkipRouteCalculation;
00158 
00160     RORouteDef_Complete* myCurrentRoute;
00161 
00163     std::string myCurrentRouteName;
00164 
00166     SUMOVTypeParameter* myCurrentVType;
00167 
00168     bool myHaveWarnedAboutDeprecatedVType;
00169     bool myHaveWarnedAboutDeprecatedRoute;
00170 
00171 private:
00173     RORDLoader_SUMOBase(const RORDLoader_SUMOBase& src);
00174 
00176     RORDLoader_SUMOBase& operator=(const RORDLoader_SUMOBase& src);
00177 
00178 };
00179 
00180 
00181 #endif
00182 
00183 /****************************************************************************/
00184 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines