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-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // The class responsible for building and deletion of meso vehicles (gui-version)
16 /****************************************************************************/
17 #ifndef GUIMEVehicleControl_h
18 #define GUIMEVehicleControl_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <vector>
30 
31 
32 // ===========================================================================
33 // class declarations
34 // ===========================================================================
35 
36 // ===========================================================================
37 // class definitions
38 // ===========================================================================
46 public:
49 
50 
53 
56 
70  const MSRoute* route, MSVehicleType* type,
71  const bool ignoreStopErrors, const bool fromRouteFile = true);
73 
82  bool addVehicle(const std::string& id, SUMOVehicle* v);
83 
91  void deleteVehicle(SUMOVehicle* v, bool discard = false);
92 
97  void insertVehicleIDs(std::vector<GUIGlID>& into);
98 
100  void secureVehicles();
101 
103  void releaseVehicles();
104 
105 
106 private:
108  mutable MFXMutex myLock;
109 
110 
111 private:
114 
117 
118 
119 };
120 
121 
122 #endif
123 
124 /****************************************************************************/
125 
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:66
GUIMEVehicleControl()
Constructor.
Representation of a vehicle.
Definition: SUMOVehicle.h:60
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.