SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GUIMEVehicleControl.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // The class responsible for building and deletion of meso vehicles (gui-version)
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2001-2016 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 #ifndef GUIMEVehicleControl_h
21 #define GUIMEVehicleControl_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <vector>
37 
38 
39 // ===========================================================================
40 // class declarations
41 // ===========================================================================
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
53 public:
56 
57 
60 
63 
77  const MSRoute* route, const MSVehicleType* type,
78  const bool ignoreStopErrors, const bool fromRouteFile = true);
80 
89  bool addVehicle(const std::string& id, SUMOVehicle* v);
90 
98  void deleteVehicle(SUMOVehicle* v, bool discard = false);
99 
104  void insertVehicleIDs(std::vector<GUIGlID>& into);
105 
107  void secureVehicles();
108 
110  void releaseVehicles();
111 
112 
113 private:
115  mutable MFXMutex myLock;
116 
117 
118 private:
121 
124 
125 
126 };
127 
128 
129 #endif
130 
131 /****************************************************************************/
132 
MFXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
void releaseVehicles()
unlock access to vehicle removal/additions for thread synchronization
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:74
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)
SUMOVehicle * buildVehicle(SUMOVehicleParameter *defs, const MSRoute *route, const MSVehicleType *type, const bool ignoreStopErrors, const bool fromRouteFile=true)
Builds a vehicle, increases the number of built vehicles.
~GUIMEVehicleControl()
Destructor.
Structure representing possible vehicle parameter.