SUMO - Simulation of Urban MObility
GUIMEVehicleControl.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-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 /****************************************************************************/
17 // The class responsible for building and deletion of meso vehicles (gui-version)
18 /****************************************************************************/
19 #ifndef GUIMEVehicleControl_h
20 #define GUIMEVehicleControl_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include <vector>
36 
37 
38 // ===========================================================================
39 // class declarations
40 // ===========================================================================
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
52 public:
55 
56 
59 
62 
76  const MSRoute* route, MSVehicleType* type,
77  const bool ignoreStopErrors, const bool fromRouteFile = true);
79 
88  bool addVehicle(const std::string& id, SUMOVehicle* v);
89 
97  void deleteVehicle(SUMOVehicle* v, bool discard = false);
98 
103  void insertVehicleIDs(std::vector<GUIGlID>& into);
104 
106  void secureVehicles();
107 
109  void releaseVehicles();
110 
111 
112 private:
114  mutable MFXMutex myLock;
115 
116 
117 private:
120 
123 
124 
125 };
126 
127 
128 #endif
129 
130 /****************************************************************************/
131 
MFXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
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.
bool addVehicle(const std::string &id, SUMOVehicle *v)
Tries to insert the vehicle into the internal vehicle container.
void secureVehicles()
lock access to vehicle removal/additions for thread synchronization
void deleteVehicle(SUMOVehicle *v, bool discard=false)
Deletes the vehicle.
The class responsible for building and deletion of vehicles (gui-version)
The car-following model and parameter.
Definition: MSVehicleType.h:72
GUIMEVehicleControl()
Constructor.
Representation of a vehicle.
Definition: SUMOVehicle.h:66
void insertVehicleIDs(std::vector< GUIGlID > &into)
Returns the list of all known vehicles by gl-id.
GUIMEVehicleControl & operator=(const GUIMEVehicleControl &s)
invalidated assignment operator
The class responsible for building and deletion of vehicles (gui-version)
~GUIMEVehicleControl()
Destructor.
Structure representing possible vehicle parameter.