Eclipse 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-2019 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>
27 #include <fx.h>
30 
31 
32 // ===========================================================================
33 // class definitions
34 // ===========================================================================
42 public:
45 
46 
49 
52 
66  const MSRoute* route, MSVehicleType* type,
67  const bool ignoreStopErrors, const bool fromRouteFile = true);
69 
78  bool addVehicle(const std::string& id, SUMOVehicle* v);
79 
87  void deleteVehicle(SUMOVehicle* v, bool discard = false);
88 
93  void insertVehicleIDs(std::vector<GUIGlID>& into);
94 
96  void secureVehicles();
97 
99  void releaseVehicles();
100 
101 
102 private:
104  mutable FXMutex myLock;
105 
106 
107 private:
110 
113 
114 
115 };
116 
117 
118 #endif
119 
120 /****************************************************************************/
121 
MSVehicleType
The car-following model and parameter.
Definition: MSVehicleType.h:66
GUIGlObject.h
GUIMEVehicleControl::GUIMEVehicleControl
GUIMEVehicleControl()
Constructor.
Definition: GUIMEVehicleControl.cpp:35
GUIMEVehicleControl::insertVehicleIDs
void insertVehicleIDs(std::vector< GUIGlID > &into)
Returns the list of all known vehicles by gl-id.
Definition: GUIMEVehicleControl.cpp:75
SUMOVehicle
Representation of a vehicle.
Definition: SUMOVehicle.h:61
SUMOVehicleParameter
Structure representing possible vehicle parameter.
Definition: SUMOVehicleParameter.h:291
GUIMEVehicleControl
The class responsible for building and deletion of vehicles (gui-version)
Definition: GUIMEVehicleControl.h:41
MSRoute
Definition: MSRoute.h:67
GUIMEVehicleControl::releaseVehicles
void releaseVehicles()
unlock access to vehicle removal/additions for thread synchronization
Definition: GUIMEVehicleControl.cpp:95
MEVehicleControl.h
GUIMEVehicleControl::~GUIMEVehicleControl
~GUIMEVehicleControl()
Destructor.
Definition: GUIMEVehicleControl.cpp:39
MEVehicleControl
The class responsible for building and deletion of vehicles (gui-version)
Definition: MEVehicleControl.h:43
GUIMEVehicleControl::addVehicle
bool addVehicle(const std::string &id, SUMOVehicle *v)
Tries to insert the vehicle into the internal vehicle container.
Definition: GUIMEVehicleControl.cpp:61
GUIMEVehicleControl::deleteVehicle
void deleteVehicle(SUMOVehicle *v, bool discard=false)
Deletes the vehicle.
Definition: GUIMEVehicleControl.cpp:68
config.h
GUIMEVehicleControl::buildVehicle
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.
Definition: GUIMEVehicleControl.cpp:48
GUIMEVehicleControl::secureVehicles
void secureVehicles()
lock access to vehicle removal/additions for thread synchronization
Definition: GUIMEVehicleControl.cpp:89
GUIMEVehicleControl::operator=
GUIMEVehicleControl & operator=(const GUIMEVehicleControl &s)
invalidated assignment operator
GUIMEVehicleControl::myLock
FXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
Definition: GUIMEVehicleControl.h:104