SUMO - Simulation of Urban MObility
GNEChange.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-2018 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 // The reification of a NETEDIT editing operation (see command pattern)
16 // inherits from FXCommand and is used to for undo/redo
17 /****************************************************************************/
18 #ifndef GNEChange_h
19 #define GNEChange_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <fx.h>
29 
30 // ===========================================================================
31 // class declarations
32 // ===========================================================================
33 class GNENet;
34 
35 // ===========================================================================
36 // class definitions
37 // ===========================================================================
42 class GNEChange : public FXCommand {
43  FXDECLARE_ABSTRACT(GNEChange)
44 
45 public:
50  GNEChange(GNENet* net, bool forward);
51 
53  ~GNEChange();
54 
56  virtual FXuint size() const;
57 
59  virtual FXString undoName() const;
60 
62  virtual FXString redoName() const;
63 
65  virtual void undo();
66 
68  virtual void redo();
69 
70 protected:
76 
80  bool myForward;
81 };
82 
83 #endif
84 /****************************************************************************/
the function-object for an editing operation (abstract base)
Definition: GNEChange.h:42
virtual void undo()
undo action/operation
Definition: GNEChange.cpp:64
GNEChange(GNENet *net, bool forward)
Constructor.
Definition: GNEChange.cpp:37
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:80
virtual FXuint size() const
return actual size
Definition: GNEChange.cpp:46
~GNEChange()
Destructor.
Definition: GNEChange.cpp:42
virtual void redo()
redo action/operation
Definition: GNEChange.cpp:68
virtual FXString undoName() const
return undoName
Definition: GNEChange.cpp:52
GNENet * myNet
the net to which operations shall be applied or which shall be informed about gui updates (we are not...
Definition: GNEChange.h:75
bool myForward
we group antagonistic commands (create junction/delete junction) and keep them apart by this flag ...
Definition: GNEChange.h:80
virtual FXString redoName() const
return rendoName
Definition: GNEChange.cpp:58