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-2016 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 // 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 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
50  FXDECLARE_ABSTRACT(GNEChange_Attribute)
51 
52 public:
60  const SumoXMLAttr key,
61  const std::string& value,
62  bool customOrigValue = false,
63  const std::string& origValue = "");
64 
65 
68 
69  FXString undoName() const;
70  FXString redoName() const;
71  void undo();
72  void redo();
73 
75  bool trueChange() {
76  return myOrigValue != myNewValue;
77  }
78 
79 
80 private:
85 
88 
90  std::string myOrigValue;
91 
93  std::string myNewValue;
94 
95 };
96 
97 #endif
98 /****************************************************************************/
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.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
FXString redoName() const
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.
GNEAttributeCarrier * myAC
the net to which all operations shall be applied (we are not responsible for the pointer) ...
FXString undoName() const
std::string myOrigValue
the original value