Eclipse SUMO - Simulation of Urban MObility
GUIEventControl.cpp
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 // Stores time-dependant events and executes them at the proper time (guisim)
16 /****************************************************************************/
17 
18 
19 // ===========================================================================
20 // included modules
21 // ===========================================================================
22 #include <config.h>
23 
24 #include <cassert>
25 #include <fx.h>
26 #include "GUIEventControl.h"
27 
28 
29 // ===========================================================================
30 // member definitions
31 // ===========================================================================
33  myLock(true)
34 {}
35 
36 
38 }
39 
40 
41 void
42 GUIEventControl::addEvent(Command* operation, SUMOTime execTimeStep) {
43  FXMutexLock locker(myLock);
44  MSEventControl::addEvent(operation, execTimeStep);
45 }
46 
47 
48 void
50  FXMutexLock locker(myLock);
51  MSEventControl::execute(execTime);
52 }
53 
54 
55 
56 /****************************************************************************/
57 
MSEventControl::addEvent
virtual void addEvent(Command *operation, SUMOTime execTimeStep=-1)
Adds an Event.
Definition: MSEventControl.cpp:52
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
GUIEventControl::myLock
FXMutex myLock
The lock used to prohibit parallel addition and processing of events.
Definition: GUIEventControl.h:76
GUIEventControl::execute
void execute(SUMOTime time)
Executes time-dependant commands.
Definition: GUIEventControl.cpp:49
GUIEventControl::GUIEventControl
GUIEventControl()
Default constructor.
Definition: GUIEventControl.cpp:32
GUIEventControl.h
GUIEventControl::addEvent
void addEvent(Command *operation, SUMOTime execTimeStep=-1)
Adds an Event.
Definition: GUIEventControl.cpp:42
Command
Base (microsim) event class.
Definition: Command.h:52
MSEventControl::execute
virtual void execute(SUMOTime time)
Executes time-dependant commands.
Definition: MSEventControl.cpp:58
GUIEventControl::~GUIEventControl
~GUIEventControl()
Destructor.
Definition: GUIEventControl.cpp:37
config.h