ufe 7.0
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 "D:/Jenkins/workspace/EMS/ECG/ufe/full/ufe-full-python3.13-windows/ufe/include/undoableCommandMgr.h"
2#ifndef UFE_UNDOABLECOMMANDMGR_H
3#define UFE_UNDOABLECOMMANDMGR_H
4
5// ===========================================================================
6// Copyright 2025 Autodesk, Inc. All rights reserved.
7//
8// The use of this software is subject to the Autodesk Terms of Use or other
9// license agreement provided at the time of installation or download, or
10// which otherwise accompanies this software.
11// ===========================================================================
12
13#include "common/ufeExport.h"
14
15#include "undoableCommand.h"
16
17#include <memory>
18
20
21class UndoableCommandGuard;
22
24
36{
37public:
38
39 typedef std::shared_ptr<UndoableCommandMgr> Ptr;
40
44 UndoableCommandMgr& operator= (const UndoableCommandMgr&) = delete;
46
49
52
57 static void initializeInstance(const Ptr& instance);
58
62 virtual void executeCmd(const UndoableCommand::Ptr& cmd) const;
63
64protected:
65
67
71 virtual void registerCmd(const UndoableCommand::Ptr& cmd) const;
72
75};
76
77
79{
80public:
81
84 explicit UndoableCommandGuard(const std::string& commandString);
86 UndoableCommandGuard& operator= (const UndoableCommandGuard&) = delete;
88
91
93 void setSuccess();
94
95private:
97};
98
99}
100
101#endif /* UFE_UNDOABLECOMMANDMGR_H */
UndoableCommandGuard(const std::string &commandString)
void setSuccess()
Set execution as a success.
virtual ~UndoableCommandGuard()
Destructor.
UndoableCommandGuard(const UndoableCommandGuard &)=delete
UndoableCommandMgr::Ptr fPreviousCommandMgr
std::shared_ptr< UndoableCommand > Ptr
Abstract base class for undoable command manager.
UndoableCommandMgr(const UndoableCommandMgr &)=delete
static UndoableCommandMgr & instance()
virtual void registerCmd(const UndoableCommand::Ptr &cmd) const
The method registers the command (i.e. without executing it) to the undo queue.
virtual ~UndoableCommandMgr()
Destructor.
virtual void executeCmd(const UndoableCommand::Ptr &cmd) const
The method directly executes the command i.e., not undoable execution.
static void initializeInstance(const Ptr &instance)
std::shared_ptr< UndoableCommandMgr > Ptr
UndoableCommandMgr()
Only derived classes can create an undoable command manager.
std::string string(const Path &path)
#define UFE_NS_DEF
Definition: ufe.h:36
Definition of macros for symbol visibility.
#define UFE_SDK_DECL
Definition: ufeExport.h:35