SUMO - Simulation of Urban MObility
GUIVehicleControl.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2003-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
19 // The class responsible for building and deletion of vehicles (gui-version)
20 /****************************************************************************/
21 #ifndef GUIVehicleControl_h
22 #define GUIVehicleControl_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <vector>
37 
38 
39 // ===========================================================================
40 // class declarations
41 // ===========================================================================
42 class MFXMutex;
43 
44 
45 // ===========================================================================
46 // class definitions
47 // ===========================================================================
59 public:
62 
63 
66 
67 
70 
84  const MSRoute* route, MSVehicleType* type,
85  const bool ignoreStopErrors, const bool fromRouteFile = true);
87 
88 
97  bool addVehicle(const std::string& id, SUMOVehicle* v);
98 
99 
107  void deleteVehicle(SUMOVehicle* v, bool discard = false);
108 
109 
116  void insertVehicleIDs(std::vector<GUIGlID>& into, bool listParking, bool listTeleporting);
117 
118 
120  void secureVehicles();
121 
123  void releaseVehicles();
124 
125 
126 private:
128  mutable MFXMutex myLock;
129 
130 
131 private:
134 
137 
138 
139 };
140 
141 
142 #endif
143 
144 /****************************************************************************/
145 
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
SUMOVehicle * buildVehicle(SUMOVehicleParameter *defs, const MSRoute *route, MSVehicleType *type, const bool ignoreStopErrors, const bool fromRouteFile=true)
Builds a vehicle, increases the number of built vehicles.
void insertVehicleIDs(std::vector< GUIGlID > &into, bool listParking, bool listTeleporting)
Returns the list of all known vehicles by gl-id.
The car-following model and parameter.
Definition: MSVehicleType.h:72
Representation of a vehicle.
Definition: SUMOVehicle.h:66
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.
The class responsible for building and deletion of vehicles.