ufe  1.0
Universal Front End is a DCC-agnostic component that will allow a DCC to browse and edit data in multiple data models
undoableCommand.h
Go to the documentation of this file.
1 #line 1 "E:/jenkins/workspace/ufe-full-windows/ufe/include/undoableCommand.h"
2 #ifndef _undoableCommand
3 #define _undoableCommand
4 // ===========================================================================
5 // Copyright 2018 Autodesk, Inc. All rights reserved.
6 //
7 // Use of this software is subject to the terms of the Autodesk license
8 // agreement provided at the time of installation or download, or which
9 // otherwise accompanies this software in either electronic or hard copy form.
10 // ===========================================================================
11 
12 #include "common/ufeExport.h"
13 
14 #include <memory>
15 #include <list>
16 #include <initializer_list>
17 
18 UFE_NS_DEF {
19 
21 
31 {
32 public:
33  typedef std::shared_ptr<UndoableCommand> Ptr;
34 
36  virtual ~UndoableCommand();
37 
40  virtual void execute();
41 
42  virtual void undo() = 0;
43  virtual void redo() = 0;
44 
45 protected:
49  UndoableCommand(const UndoableCommand&) = delete;
50 };
51 
53 
63 {
64 public:
65 
68  static std::shared_ptr<CompositeUndoableCommand> create(
69  std::initializer_list<Ptr> undoableCommands
70  );
71 
75  CompositeUndoableCommand(std::initializer_list<Ptr> undoableCommands);
76  CompositeUndoableCommand(const std::list<Ptr>& undoableCommands);
78  ~CompositeUndoableCommand() override;
80 
82  void execute() override;
83 
85  void undo() override;
86 
88  void redo() override;
89 
91  void append(const Ptr& cmd);
92 
93 private:
96 
97  typedef std::list<Ptr> CmdList;
98 
99  CmdList fCmds;
100 };
101 
102 }
103 
104 #endif /* _undoableCommand */
virtual void redo()=0
std::shared_ptr< UndoableCommand > Ptr
Definition of macros for symbol visibility.
Composite undoable command.
#define UFE_NS_DEF
Definition: ufe.h:35
Abstract base class for undoable commands.
virtual void execute()
virtual void undo()=0
#define UFE_SDK_DECL
Definition: ufeExport.h:36