ufe 5.5
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.11-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
19
20class UndoableCommandGuard;
21
23
35{
36public:
37
38 typedef std::shared_ptr<UndoableCommandMgr> Ptr;
39
41
43 UndoableCommandMgr& operator= (const UndoableCommandMgr&) = delete;
45
48
51
56 static void initializeInstance(const Ptr& instance);
57
61 virtual void executeCmd(const UndoableCommand::Ptr& cmd) const;
62
63protected:
64
66
70 virtual void registerCmd(const UndoableCommand::Ptr& cmd) const;
71
74};
75
76
78{
79public:
80
82
83 explicit UndoableCommandGuard(const std::string& commandString);
85 UndoableCommandGuard& operator= (const UndoableCommandGuard&) = delete;
87
90
92 void setSuccess();
93
94private:
96};
97
98}
99
100#endif /* _undoableCommandMgr */
UndoableCommandGuard(const std::string &commandString)
Constructors.
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
Constructors.
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:35
Definition of macros for symbol visibility.
#define UFE_SDK_DECL
Definition: ufeExport.h:36