SUMO - Simulation of Urban MObility
GNEChange_Attribute.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // A network change in which the attribute of some object is modified
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 #ifndef GNEChange_Attribute_h
21 #define GNEChange_Attribute_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <fx.h>
36 #include "GNEChange.h"
37 
38 // ===========================================================================
39 // class declarations
40 // ===========================================================================
42 class GNEAdditional;
43 class GNEShape;
44 
45 // ===========================================================================
46 // class definitions
47 // ===========================================================================
53  FXDECLARE_ABSTRACT(GNEChange_Attribute)
54 
55 public:
63  const SumoXMLAttr key,
64  const std::string& value,
65  bool customOrigValue = false,
66  const std::string& origValue = "");
67 
68 
71 
75  FXString undoName() const;
76 
78  FXString redoName() const;
79 
81  void undo();
82 
84  void redo();
86 
88  bool trueChange();
89 
90 private:
95 
98 
100  std::string myOrigValue;
101 
103  std::string myNewValue;
104 
107 
110 };
111 
112 #endif
113 /****************************************************************************/
void redo()
redo action
the function-object for an editing operation (abstract base)
Definition: GNEChange.h:49
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.
FXString redoName() const
get Redo name
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.
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:62
GNEAttributeCarrier * myAC
the net to which all operations shall be applied
GNEShape * myShape
used if Ac is a shape element
FXString undoName() const
return undoName
std::string myOrigValue
the original value