SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUILane.cpp
Go to the documentation of this file.
1 /****************************************************************************/
9 // Representation of a lane in the micro simulation (gui-version)
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
12 // Copyright (C) 2001-2013 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 
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 <string>
34 #include <utility>
36 #include <utils/geom/Position.h>
38 #include <microsim/MSLane.h>
41 #include <microsim/MSNet.h>
42 #include "GUILane.h"
43 #include "GUIVehicle.h"
44 #include "GUINet.h"
45 
46 #ifdef CHECK_MEMORY_LEAKS
47 #include <foreign/nvwa/debug_new.h>
48 #endif // CHECK_MEMORY_LEAKS
49 
50 
51 // ===========================================================================
52 // method definitions
53 // ===========================================================================
54 GUILane::GUILane(const std::string& id, SUMOReal maxSpeed, SUMOReal length,
55  MSEdge* const edge, unsigned int numericalID,
56  const PositionVector& shape, SUMOReal width,
57  SVCPermissions permissions) :
58  MSLane(id, maxSpeed, length, edge, numericalID, shape, width, permissions) {}
59 
60 
62  // just to quit cleanly on a failure
63  if (myLock.locked()) {
64  myLock.unlock();
65  }
66 }
67 
68 
69 // ------ Vehicle insertion ------
70 void
72  const MSLane::VehCont::iterator& at,
73  MSMoveReminder::Notification notification) {
75  MSLane::incorporateVehicle(veh, pos, speed, at, notification);
76 }
77 
78 
79 // ------ Access to vehicles ------
80 const MSLane::VehCont&
82  myLock.lock();
83  return myVehicles;
84 }
85 
86 
87 void
89  myLock.unlock();
90 }
91 
92 
93 bool
96  return MSLane::planMovements(t);
97 }
98 
99 
100 bool
101 GUILane::executeMovements(SUMOTime t, std::vector<MSLane*>& into) {
103  return MSLane::executeMovements(t, into);
104 }
105 
106 
107 MSVehicle*
110  return MSLane::removeVehicle(remVehicle);
111 }
112 
113 
114 void
118 }
119 
120 
121 bool
124  return MSLane::integrateNewVehicle(t);
125 }
126 
127 
129 GUILane::buildLaneWrapper(unsigned int index) {
130  return new GUILaneWrapper(*this, myShape, index);
131 }
132 
133 
134 void
135 GUILane::detectCollisions(SUMOTime timestep, int stage) {
137  MSLane::detectCollisions(timestep, stage);
138 }
139 
140 
141 
142 /****************************************************************************/
143