SUMO - Simulation of Urban MObility

MSVehicleTransfer.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // A mover of vehicles that got stucked due to grid locks
00008 // This class also serves as container for parking vehicles
00009 /****************************************************************************/
00010 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00011 // Copyright (C) 2001-2011 DLR (http://www.dlr.de/) and contributors
00012 /****************************************************************************/
00013 //
00014 //   This program is free software; you can redistribute it and/or modify
00015 //   it under the terms of the GNU General Public License as published by
00016 //   the Free Software Foundation; either version 2 of the License, or
00017 //   (at your option) any later version.
00018 //
00019 /****************************************************************************/
00020 #ifndef MSVehicleTransfer_h
00021 #define MSVehicleTransfer_h
00022 
00023 
00024 // ===========================================================================
00025 // included modules
00026 // ===========================================================================
00027 #ifdef _MSC_VER
00028 #include <windows_config.h>
00029 #else
00030 #include <config.h>
00031 #endif
00032 
00033 #include <string>
00034 #include <vector>
00035 
00036 
00037 // ===========================================================================
00038 // class declarations
00039 // ===========================================================================
00040 class MSVehicle;
00041 class MSEdge;
00042 
00043 
00044 // ===========================================================================
00045 // class definitions
00046 // ===========================================================================
00062 class MSVehicleTransfer {
00063 public:
00065     virtual ~MSVehicleTransfer() throw();
00066 
00067 
00076     void addVeh(const SUMOTime t, MSVehicle* veh) throw();
00077 
00078 
00087     void checkInsertions(SUMOTime time) throw();
00088 
00089 
00094     bool hasPending() const throw();
00095 
00096 
00100     static MSVehicleTransfer* getInstance() throw();
00101 
00102 
00103 private:
00105     MSVehicleTransfer() throw();
00106 
00107 
00108 protected:
00113     struct VehicleInformation {
00115         MSVehicle* myVeh;
00117         SUMOTime myProceedTime;
00119         bool myParking;
00120 
00126         VehicleInformation(MSVehicle* veh, SUMOTime proceedTime, bool parking) throw()
00127             : myVeh(veh), myProceedTime(proceedTime), myParking(parking) { }
00128 
00129     };
00130 
00131 
00133     typedef std::vector<VehicleInformation> VehicleInfVector;
00134 
00136     VehicleInfVector myVehicles;
00137 
00139     static MSVehicleTransfer* myInstance;
00140 
00141 };
00142 
00143 
00144 #endif
00145 
00146 /****************************************************************************/
00147 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines