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 /****************************************************************************/ 10 /// @file GNEChange_DemandElement.h 11 /// @author Pablo Alvarez Lopez 12 /// @date Jan 2019 13 /// @version $Id$ 14 /// 15 // A network change in which a demand element element is created or deleted 16 /****************************************************************************/ 17 #ifndef GNEChange_DemandElement_h 18 #define GNEChange_DemandElement_h 19 20 // =========================================================================== 21 // included modules 22 // =========================================================================== 23 #include <config.h> 24 25 #include "GNEChange.h" 26 27 // =========================================================================== 28 // class declarations 29 // =========================================================================== 30 31 class GNEViewNet; 32 class GNEEdge; 33 class GNELane; 34 class GNEShape; 35 class GNEAdditional; 36 class GNEDemandElement; 37 38 // =========================================================================== 39 // class definitions 40 // =========================================================================== 41 /** 42 * @class GNEChange_DemandElement 43 * A network change in which a demand element element is created or deleted 44 */ 45 class GNEChange_DemandElement : public GNEChange { 46 FXDECLARE_ABSTRACT(GNEChange_DemandElement) 47 48 public: 49 /**@brief Constructor for creating/deleting an demand element element 50 * @param[in] demand element The demand element element to be created/deleted 51 * @param[in] forward Whether to create/delete (true/false) 52 */ 53 GNEChange_DemandElement(GNEDemandElement* demandElement, bool forward); 54 55 /// @brief Destructor 56 ~GNEChange_DemandElement(); 57 58 /// @name inherited from GNEChange 59 /// @{ 60 /// @brief get undo Name 61 FXString undoName() const; 62 63 /// @brief get Redo name 64 FXString redoName() const; 65 66 /// @brief undo action 67 void undo(); 68 69 /// @brief redo action 70 void redo(); 71 /// @} 72 73 private: 74 /**@brief full information regarding the demand element element that is to be created/deleted 75 * @note we assume shared responsibility for the pointer (via reference counting) 76 */ 77 GNEDemandElement* myDemandElement; 78 79 /// @brief reference to vector of edge parents 80 const std::vector<GNEEdge*>& myEdgeParents; 81 82 /// @brief reference to vector of lane parents 83 const std::vector<GNELane*>& myLaneParents; 84 85 /// @brief reference to vector of shape parents 86 const std::vector<GNEShape*>& myShapeParents; 87 88 /// @brief reference to vector of additional parents 89 const std::vector<GNEAdditional*>& myAdditionalParents; 90 91 /// @brief reference to vector of demand element parents 92 const std::vector<GNEDemandElement*>& myDemandElementParents; 93 94 /// @brief reference to vector of edge childs 95 const std::vector<GNEEdge*>& myEdgeChilds; 96 97 /// @brief reference to vector of lane childs 98 const std::vector<GNELane*>& myLaneChilds; 99 100 /// @brief reference to vector of shape childs 101 const std::vector<GNEShape*>& myShapeChilds; 102 103 /// @brief reference to vector of additional childs 104 const std::vector<GNEAdditional*>& myAdditionalChilds; 105 106 /// @brief reference to vector of demand element childs 107 const std::vector<GNEDemandElement*>& myDemandElementChilds; 108 }; 109 110 #endif 111 /****************************************************************************/ 112