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 /****************************************************************************/
14 // The class responsible for building and deletion of meso vehicles (gui-version)
15 /****************************************************************************/
16 #ifndef GUIMEVehicleControl_h
17 #define GUIMEVehicleControl_h
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 #include <vector>
26 #include <fx.h>
29 
30 
31 // ===========================================================================
32 // class definitions
33 // ===========================================================================
41 public:
44 
45 
48 
51 
65  const MSRoute* route, MSVehicleType* type,
66  const bool ignoreStopErrors, const bool fromRouteFile = true);
68 
77  bool addVehicle(const std::string& id, SUMOVehicle* v);
78 
86  void deleteVehicle(SUMOVehicle* v, bool discard = false);
87 
92  void insertVehicleIDs(std::vector<GUIGlID>& into);
93 
95  void secureVehicles();
96 
98  void releaseVehicles();
99 
100 
101 private:
103  mutable FXMutex myLock;
104 
105 
106 private:
109 
112 
113 
114 };
115 
116 
117 #endif
118 
119 /****************************************************************************/
120 
MSVehicleType
The car-following model and parameter.
Definition: MSVehicleType.h:65
GUIGlObject.h
GUIMEVehicleControl::GUIMEVehicleControl
GUIMEVehicleControl()
Constructor.
Definition: GUIMEVehicleControl.cpp:34
GUIMEVehicleControl::insertVehicleIDs
void insertVehicleIDs(std::vector< GUIGlID > &into)
Returns the list of all known vehicles by gl-id.
Definition: GUIMEVehicleControl.cpp:74
SUMOVehicle
Representation of a vehicle.
Definition: SUMOVehicle.h:60
SUMOVehicleParameter
Structure representing possible vehicle parameter.
Definition: SUMOVehicleParameter.h:297
GUIMEVehicleControl
The class responsible for building and deletion of vehicles (gui-version)
Definition: GUIMEVehicleControl.h:40
MSRoute
Definition: MSRoute.h:66
GUIMEVehicleControl::releaseVehicles
void releaseVehicles()
unlock access to vehicle removal/additions for thread synchronization
Definition: GUIMEVehicleControl.cpp:94
MEVehicleControl.h
GUIMEVehicleControl::~GUIMEVehicleControl
~GUIMEVehicleControl()
Destructor.
Definition: GUIMEVehicleControl.cpp:38
MEVehicleControl
The class responsible for building and deletion of vehicles (gui-version)
Definition: MEVehicleControl.h:42
GUIMEVehicleControl::addVehicle
bool addVehicle(const std::string &id, SUMOVehicle *v)
Tries to insert the vehicle into the internal vehicle container.
Definition: GUIMEVehicleControl.cpp:60
GUIMEVehicleControl::deleteVehicle
void deleteVehicle(SUMOVehicle *v, bool discard=false)
Deletes the vehicle.
Definition: GUIMEVehicleControl.cpp:67
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:47
GUIMEVehicleControl::secureVehicles
void secureVehicles()
lock access to vehicle removal/additions for thread synchronization
Definition: GUIMEVehicleControl.cpp:88
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:103