ufe  4.2
Universal Front End is a DCC-agnostic component that will allow a DCC to browse and edit data in multiple data models
undoableCommandMgr.h
Go to the documentation of this file.
1 #line 1 "S:/jenkins/workspace/ECP/ufe/ufe-full-python3.10-windows/ufe/include/undoableCommandMgr.h"
2 #ifndef _undoableCommandMgr
3 #define _undoableCommandMgr
4 // ===========================================================================
5 // Copyright 2022 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 "undoableCommand.h"
15 
16 #include <memory>
17 
18 UFE_NS_DEF {
19 
20 class UndoableCommandGuard;
21 
23 
35 {
36 public:
37 
38  typedef std::shared_ptr<UndoableCommandMgr> Ptr;
39 
41  UndoableCommandMgr(const UndoableCommandMgr&) = delete;
43  UndoableCommandMgr& operator= (const UndoableCommandMgr&) = delete;
45 
47  virtual ~UndoableCommandMgr();
48 
50  static UndoableCommandMgr& instance();
51 
56  static void initializeInstance(const Ptr& instance);
57 
61  virtual void executeCmd(const UndoableCommand::Ptr& cmd) const;
62 
63 protected:
64 
65  friend class UndoableCommandGuard;
66 
70  virtual void registerCmd(const UndoableCommand::Ptr& cmd) const;
71 
74 };
75 
76 
78 {
79 public:
80 
82  explicit UndoableCommandGuard(const std::string& commandString);
85  UndoableCommandGuard& operator= (const UndoableCommandGuard&) = delete;
87 
89  virtual ~UndoableCommandGuard();
90 
92  void setSuccess();
93 
94 private:
96 };
97 
98 }
99 
100 #endif /* _undoableCommandMgr */
std::shared_ptr< UndoableCommand > Ptr
UndoableCommandMgr::Ptr fPreviousCommandMgr
std::string string(const Path &path)
Definition of macros for symbol visibility.
std::shared_ptr< UndoableCommandMgr > Ptr
#define UFE_NS_DEF
Definition: ufe.h:35
void initializeInstance(const Ptr &globalSelection)
Abstract base class for undoable command manager.
#define UFE_SDK_DECL
Definition: ufeExport.h:36