Eclipse SUMO - Simulation of Urban MObility
GNEChange_Attribute.h
Go to the documentation of this file.
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 /****************************************************************************/
15 // A network change in which the attribute of some object is modified
16 /****************************************************************************/
17 #ifndef GNEChange_Attribute_h
18 #define GNEChange_Attribute_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <fx.h>
29 #include "GNEChange.h"
30 
31 // ===========================================================================
32 // class declarations
33 // ===========================================================================
35 class GNENetElement;
36 class GNEAdditional;
37 class GNEDemandElement;
38 class GNEShape;
39 class GNENet;
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
49  FXDECLARE_ABSTRACT(GNEChange_Attribute)
50 
51 public:
59  GNENet* net,
60  const SumoXMLAttr key,
61  const std::string& value,
62  bool customOrigValue = false,
63  const std::string& origValue = "");
64 
73  GNENet* net,
74  bool forceChange,
75  const SumoXMLAttr key,
76  const std::string& value);
77 
80 
84  FXString undoName() const;
85 
87  FXString redoName() const;
88 
90  void undo();
91 
93  void redo();
95 
97  bool trueChange();
98 
99 private:
104 
107 
110 
112  const std::string myOrigValue;
113 
115  const std::string myNewValue;
116 };
117 
118 #endif
119 /****************************************************************************/
void redo()
redo action
the function-object for an editing operation (abstract base)
Definition: GNEChange.h:43
void undo()
undo action
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:78
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
the function-object for an editing operation (abstract base)
bool trueChange()
wether original and new value differ
~GNEChange_Attribute()
Destructor.
FXString undoName() const
return undoName
const std::string myNewValue
the original value
const SumoXMLAttr myKey
The attribute name (or the original attribute if we&#39;re editing a disjoint attribute) ...
bool myForceChange
flag used to force set attributes
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:47
FXString redoName() const
get Redo name
GNEAttributeCarrier * myAC
the net to which all operations shall be applied
GNEChange_Attribute(GNEAttributeCarrier *ac, GNENet *net, const SumoXMLAttr key, const std::string &value, bool customOrigValue=false, const std::string &origValue="")
Constructor.
const std::string myOrigValue
the original value
An Element which don&#39;t belongs to GNENet but has influency in the simulation.