Path: blob/main/src/netedit/changes/GNEChange_Children.h
169678 views
/****************************************************************************/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_Children.h14/// @author Pablo Alvarez Lopez15/// @date Jul 201916///17// A network change used to modify sorting of hierarchical element children18/****************************************************************************/19#pragma once20#include <config.h>2122#include "GNEChange.h"2324// ===========================================================================25// class definitions26// ===========================================================================27/**28* @class GNEChange_Children29* A network change in which a additional element is created or deleted30*/31class GNEChange_Children : public GNEChange {32FXDECLARE_ABSTRACT(GNEChange_Children)3334public:35// @brief operation over child demand element36enum Operation {37MOVE_FRONT = 0, // Move element one position front38MOVE_BACK = 1 // Move element one position back39};4041/**@brief Constructor for creating/deleting an additional element42* @param[in] additional The additional element to be created/deleted43* @param[in] forward Whether to create/delete (true/false)44*/45GNEChange_Children(GNEDemandElement* demandElementParent, GNEDemandElement* demandElementChild, const Operation operation);4647/// @brief Destructor48~GNEChange_Children();4950/// @name inherited from GNEChange51/// @{52/// @brief get undo Name53std::string undoName() const;5455/// @brief get Redo name56std::string redoName() const;5758/// @brief undo action59void undo();6061/// @brief redo action62void redo();63/// @}6465private:66/**@brief full information regarding the parent demand element element that will be modified67* @note we assume shared responsibility for the pointer (via reference counting)68*/69GNEDemandElement* myParentDemandElement;7071/// @brief demand element which position will be edited edited72GNEDemandElement* myChildDemandElement;7374// @brief Operation to be apply75const Operation myOperation;7677/// @brief copy of child demand elements before apply operation78const GNEHierarchicalContainerChildren<GNEDemandElement*> myOriginalChildElements;7980/// @brief element children after apply operation81GNEHierarchicalContainerChildren<GNEDemandElement*> myEditedChildElements;82};838485