SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUIVehicleControl.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // The class responsible for building and deletion of vehicles (gui-version)
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
12 // Copyright (C) 2003-2014 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef GUIVehicleControl_h
23 #define GUIVehicleControl_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <vector>
38 
39 
40 // ===========================================================================
41 // class declarations
42 // ===========================================================================
43 class MFXMutex;
44 
45 
46 // ===========================================================================
47 // class definitions
48 // ===========================================================================
60 public:
63 
64 
67 
68 
71 
83  const MSRoute* route, const MSVehicleType* type);
85 
86 
95  bool addVehicle(const std::string& id, SUMOVehicle* v);
96 
97 
105  void deleteVehicle(SUMOVehicle* v, bool discard = false);
106 
107 
112  void insertVehicleIDs(std::vector<GUIGlID>& into);
113 
114 
116  void secureVehicles();
117 
119  void releaseVehicles();
120 
121 
122 private:
124  mutable MFXMutex myLock;
125 
126 
127 private:
130 
133 
134 
135 };
136 
137 
138 #endif
139 
140 /****************************************************************************/
141 
The class responsible for building and deletion of vehicles (gui-version)
MFXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
GUIVehicleControl()
Constructor.
void releaseVehicles()
unlock access to vehicle removal/additions for thread synchronization
The car-following model and parameter.
Definition: MSVehicleType.h:74
Representation of a vehicle.
Definition: SUMOVehicle.h:64
bool addVehicle(const std::string &id, SUMOVehicle *v)
Tries to insert the vehicle into the internal vehicle container.
GUIVehicleControl & operator=(const GUIVehicleControl &s)
invalidated assignment operator
SUMOVehicle * buildVehicle(SUMOVehicleParameter *defs, const MSRoute *route, const MSVehicleType *type)
Builds a vehicle, increases the number of built vehicles.
Structure representing possible vehicle parameter.
void secureVehicles()
lock access to vehicle removal/additions for thread synchronization
~GUIVehicleControl()
Destructor.
void deleteVehicle(SUMOVehicle *v, bool discard=false)
Deletes the vehicle.
void insertVehicleIDs(std::vector< GUIGlID > &into)
Returns the list of all known vehicles by gl-id.
The class responsible for building and deletion of vehicles.