SUMO - Simulation of Urban MObility

RORouteDef.h

Go to the documentation of this file.
00001 /****************************************************************************/
00008 // Base class for a vehicle's route definition
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 RORouteDef_h
00022 #define RORouteDef_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 <iostream>
00036 #include <utils/common/Named.h>
00037 #include "ReferencedItem.h"
00038 #include <utils/common/SUMOAbstractRouter.h>
00039 #include <utils/common/RGBColor.h>
00040 
00041 
00042 // ===========================================================================
00043 // class declarations
00044 // ===========================================================================
00045 class ROEdge;
00046 class RORoute;
00047 class OptionsCont;
00048 class ROVehicle;
00049 class OutputDevice;
00050 
00051 
00052 // ===========================================================================
00053 // class definitions
00054 // ===========================================================================
00064 class RORouteDef : public ReferencedItem, public Named {
00065 public:
00071     RORouteDef(const std::string& id, const RGBColor* const color) ;
00072 
00073 
00075     virtual ~RORouteDef() ;
00076 
00077 
00081     virtual RORoute* buildCurrentRoute(SUMOAbstractRouter<ROEdge, ROVehicle> &router, SUMOTime begin,
00082                                        const ROVehicle& veh) const = 0;
00083 
00087     virtual void addAlternative(SUMOAbstractRouter<ROEdge, ROVehicle> &router,
00088                                 const ROVehicle* const, RORoute* current, SUMOTime begin) = 0;
00089 
00091     virtual RORouteDef* copy(const std::string& id) const = 0;
00092 
00094     const RGBColor* getColor() const {
00095         return myColor;
00096     }
00097 
00098 
00107     virtual OutputDevice& writeXMLDefinition(SUMOAbstractRouter<ROEdge, ROVehicle> &router,
00108             OutputDevice& dev, const ROVehicle* const veh,
00109             bool asAlternatives, bool withExitTimes) const = 0;
00110 
00111 protected:
00112     const RGBColor* copyColorIfGiven() const ;
00113 
00114 protected:
00116     const RGBColor* const myColor;
00117 
00118 
00119 private:
00121     RORouteDef(const RORouteDef& src);
00122 
00124     RORouteDef& operator=(const RORouteDef& src);
00125 
00126 };
00127 
00128 
00129 #endif
00130 
00131 /****************************************************************************/
00132 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines