/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file GUIEventControl.h14/// @author Daniel Krajzewicz15/// @author Michael Behrisch16/// @date Mon, 04 Feb 200817///18// Stores time-dependant events and executes them at the proper time (guisim)19/****************************************************************************/20#pragma once21#include <config.h>2223#include <utils/foxtools/fxheader.h>24#include <microsim/MSEventControl.h>252627// ===========================================================================28// class definitions29// ===========================================================================30/**31* @class GUIEventControl32* @brief Stores time-dependant events and executes them at the proper time (guisim)33*34* Encapsulates MSEventControl-methods using a lock, prohibiting parallel addition /35* processing of events what may yield in application break due to broken containers.36*/37class GUIEventControl : public MSEventControl {38public:39/// @brief Default constructor.40GUIEventControl();414243/// @brief Destructor.44~GUIEventControl();454647/** @brief Adds an Event.48*49* Locks itself before calling MSEventControl::addEvent. Unlock itself50* after the call.51*52* @param[in] operation The event to add53* @param[in] execTimeStep The time the event shall be executed at (-1 means at sim start)54* @see MSEventControl::addEvent55*/56void addEvent(Command* operation, SUMOTime execTimeStep = -1);575859/** @brief Executes time-dependant commands60*61* Locks itself before calling MSEventControl::execute. Unlock itself62* after the call.63*64* @param[in] time The current simulation time65* @exception ProcessError From an executed Command66* @see MSEventControl::execute67*/68void execute(SUMOTime time);697071private:72/// @brief The lock used to prohibit parallel addition and processing of events73FXMutex myLock;747576private:77/// @brief invalid copy constructor.78GUIEventControl(const GUIEventControl&);7980/// @brief invalid assignment operator.81GUIEventControl& operator=(const GUIEventControl&);828384};858687