/****************************************************************************/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 GUIViewUpdater.cpp14/// @author Pablo Alvarez Lopez15/// @date Nov 202416///17// class used for enable/disable updating view18/****************************************************************************/19#include <config.h>2021#include <utils/common/MsgHandler.h>2223#include "GUIViewUpdater.h"2425// ===========================================================================26// method definitions27// ===========================================================================2829GUIViewUpdater::GUIViewUpdater() {}303132bool33GUIViewUpdater::allowUpdate() {34#ifdef DISABLE_VIEWUPDATER35return true;36#endif3738#ifdef DEBUG_VIEWUPDATER39if (myAllowUpdate == 0) {40numAllowedUpdates++;41} else {42numDisallowedUpdates++;43}44std::cout << "AllowedUpdates: " << numAllowedUpdates << ", disallowedUpdates: " << numDisallowedUpdates << std::endl;45#endif46return myAllowUpdate == 0;47}484950void51GUIViewUpdater::enableUpdate() {52myAllowUpdate--;53if (myAllowUpdate < 0) {54WRITE_ERROR("myAllowUpdate cannot be less than 0");55}56}575859void60GUIViewUpdater::disableUpdate() {61myAllowUpdate++;62}6364/****************************************************************************/656667