SUMO - Simulation of Urban MObility
GUIVehicleControl.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // The class responsible for building and deletion of vehicles (gui-version)
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2003-2015 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef GUIVehicleControl_h
23 #define GUIVehicleControl_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <vector>
38 
39 
40 // ===========================================================================
41 // class declarations
42 // ===========================================================================
43 class MFXMutex;
44 
45 
46 // ===========================================================================
47 // class definitions
48 // ===========================================================================
60 public:
63 
64 
67 
68 
71 
85  const MSRoute* route, const MSVehicleType* type,
86  const bool ignoreStopErrors, const bool fromRouteFile = true);
88 
89 
98  bool addVehicle(const std::string& id, SUMOVehicle* v);
99 
100 
108  void deleteVehicle(SUMOVehicle* v, bool discard = false);
109 
110 
115  void insertVehicleIDs(std::vector<GUIGlID>& into);
116 
117 
119  void secureVehicles();
120 
122  void releaseVehicles();
123 
124 
125 private:
127  mutable MFXMutex myLock;
128 
129 
130 private:
133 
136 
137 
138 };
139 
140 
141 #endif
142 
143 /****************************************************************************/
144 
The class responsible for building and deletion of vehicles (gui-version)
MFXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
GUIVehicleControl()
Constructor.
void releaseVehicles()
unlock access to vehicle removal/additions for thread synchronization
The car-following model and parameter.
Definition: MSVehicleType.h:74
SUMOVehicle * buildVehicle(SUMOVehicleParameter *defs, const MSRoute *route, const MSVehicleType *type, const bool ignoreStopErrors, const bool fromRouteFile=true)
Builds a vehicle, increases the number of built vehicles.
Representation of a vehicle.
Definition: SUMOVehicle.h:65
bool addVehicle(const std::string &id, SUMOVehicle *v)
Tries to insert the vehicle into the internal vehicle container.
GUIVehicleControl & operator=(const GUIVehicleControl &s)
invalidated assignment operator
Structure representing possible vehicle parameter.
void secureVehicles()
lock access to vehicle removal/additions for thread synchronization
~GUIVehicleControl()
Destructor.
void deleteVehicle(SUMOVehicle *v, bool discard=false)
Deletes the vehicle.
void insertVehicleIDs(std::vector< GUIGlID > &into)
Returns the list of all known vehicles by gl-id.
The class responsible for building and deletion of vehicles.