/****************************************************************************/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 GNEChange_TLS.h14/// @author Jakob Erdmann15/// @date July 201116///17// A network change in which a traffic light is created or deleted18/****************************************************************************/19#pragma once20#include <config.h>2122#include "GNEChange.h"2324class GNEJunction;2526// ===========================================================================27// class definitions28// ===========================================================================29/**30* @class GNEChange_TLS31* A network change in which a traffic light is created or deleted32*/33class GNEChange_TLS : public GNEChange {34FXDECLARE_ABSTRACT(GNEChange_TLS)3536public:37/**@brief Constructor for creating/deleting a TLS38* @param[in] junction The junction to which the traffic light belong39* @param[in] tlDef The traffic light definition (may be 0 on creation)40* @param[in] forward Whether to create/delete (true/false)41* @param[in] tlID The id for the newly created tlDef (set to junction id if * "" is given)42*/43GNEChange_TLS(GNEJunction* junction, NBTrafficLightDefinition* tlDef, bool forward, bool forceInsert = false, const std::string tlID = "");4445/**@brief Constructor for creating/deleting a TLS46* @param[in] junction The junction to which the traffic light belong47* @param[in] tlDef The traffic light definition (may be 0 on creation)48* @param[in] forward Whether to create/delete (true/false)49* @param[in] tlID The id for the newly created tlDef (set to junction id if * "" is given)50* @param[in] type TrafficLightType51*/52GNEChange_TLS(GNEJunction* junction, NBTrafficLightDefinition* tlDef, bool forward, TrafficLightType type,53bool forceInsert = false, const std::string tlID = "");5455/**@brief Constructor for renaming a TLS56* @param[in] junction The junction to which the traffic light belong57* @param[in] tlDef The traffic light definition (may be 0 on creation)58* @param[in] newID new TL ID59*/60GNEChange_TLS(GNEJunction* junction, NBTrafficLightDefinition* tlDef, const std::string& newID);6162/// @brief Destructor63~GNEChange_TLS();6465/// @name inherited from GNEChange66/// @{67/// @brief get undo Name68std::string undoName() const;6970/// @brief get Redo name71std::string redoName() const;7273/// @brief undo action74void undo();7576/// @brief redo action77void redo();7879/// @}8081private:82/**@brief we need the junction because it is the target of our change commands83* @note we assume shared responsibilty for the junction via reference counting84*/85GNEJunction* myJunction;8687/**@brief the traffic light to be created/deleted. We assume no responsibility for the pointer88* @note since it is hard to track by which NBnodes a tlDef is used (may be more than one).89*/90NBTrafficLightDefinition* myTlDef;9192/// @brief check if forceInsert is enabled93const bool myForceInsert;9495/// @brief variables used for renaming TLS96const std::string myOldID;97const std::string myNewID;98};99100101