SUMO - Simulation of Urban MObility
MSVehicleTransfer.h
Go to the documentation of this file.
00001 /****************************************************************************/
00008 // A mover of vehicles that got stucked due to grid locks
00009 // This class also serves as container for parking vehicles
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 MSVehicleTransfer_h
00023 #define MSVehicleTransfer_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 <vector>
00037 
00038 
00039 // ===========================================================================
00040 // class declarations
00041 // ===========================================================================
00042 class MSVehicle;
00043 class MSEdge;
00044 
00045 
00046 // ===========================================================================
00047 // class definitions
00048 // ===========================================================================
00064 class MSVehicleTransfer {
00065 public:
00067     virtual ~MSVehicleTransfer() ;
00068 
00069 
00078     void addVeh(const SUMOTime t, MSVehicle* veh) ;
00079 
00080 
00089     void checkInsertions(SUMOTime time) ;
00090 
00091 
00096     bool hasPending() const ;
00097 
00098 
00102     static MSVehicleTransfer* getInstance() ;
00103 
00104 
00105 private:
00107     MSVehicleTransfer() ;
00108 
00109 
00110 protected:
00115     struct VehicleInformation {
00117         MSVehicle* myVeh;
00119         SUMOTime myProceedTime;
00121         bool myParking;
00122 
00128         VehicleInformation(MSVehicle* veh, SUMOTime proceedTime, bool parking)
00129             : myVeh(veh), myProceedTime(proceedTime), myParking(parking) { }
00130 
00131     };
00132 
00133 
00135     typedef std::vector<VehicleInformation> VehicleInfVector;
00136 
00138     VehicleInfVector myVehicles;
00139 
00141     static MSVehicleTransfer* myInstance;
00142 
00143 };
00144 
00145 
00146 #endif
00147 
00148 /****************************************************************************/
00149 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines