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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 // A network change in which the attribute of some object is modified
18 /****************************************************************************/
19 #ifndef GNEChange_Attribute_h
20 #define GNEChange_Attribute_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include <fx.h>
35 #include "GNEChange.h"
36 
37 // ===========================================================================
38 // class declarations
39 // ===========================================================================
41 class GNEAdditional;
42 class GNEShape;
43 
44 // ===========================================================================
45 // class definitions
46 // ===========================================================================
52  FXDECLARE_ABSTRACT(GNEChange_Attribute)
53 
54 public:
62  const SumoXMLAttr key,
63  const std::string& value,
64  bool customOrigValue = false,
65  const std::string& origValue = "");
66 
67 
70 
74  FXString undoName() const;
75 
77  FXString redoName() const;
78 
80  void undo();
81 
83  void redo();
85 
87  bool trueChange();
88 
89 private:
94 
97 
99  std::string myOrigValue;
100 
102  std::string myNewValue;
103 
106 
109 };
110 
111 #endif
112 /****************************************************************************/
void redo()
redo action
the function-object for an editing operation (abstract base)
Definition: GNEChange.h:48
GNEChange_Attribute(GNEAttributeCarrier *ac, const SumoXMLAttr key, const std::string &value, bool customOrigValue=false, const std::string &origValue="")
Constructor.
SumoXMLAttr myKey
The attribute name.
void undo()
undo action
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
the function-object for an editing operation (abstract base)
bool trueChange()
wether original and new value differ
std::string myNewValue
the original value
~GNEChange_Attribute()
Destructor.
FXString undoName() const
return undoName
GNEAdditional * myAdditional
used if Ac is an additional element
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:59
FXString redoName() const
get Redo name
GNEAttributeCarrier * myAC
the net to which all operations shall be applied
GNEShape * myShape
used if Ac is a shape element
std::string myOrigValue
the original value