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
Ufe::UndoableCommandMgr Class Reference

Abstract base class for undoable command manager. More...

#include <undoableCommandMgr.h>

Public Types

typedef std::shared_ptr< UndoableCommandMgrPtr
 

Public Member Functions

 UndoableCommandMgr (const UndoableCommandMgr &)=delete
 Constructors. More...
 
UndoableCommandMgroperator= (const UndoableCommandMgr &)=delete
 
virtual ~UndoableCommandMgr ()
 Destructor. More...
 
virtual void executeCmd (const UndoableCommand::Ptr &cmd) const
 The method directly executes the command i.e., not undoable execution. More...
 

Static Public Member Functions

static UndoableCommandMgrinstance ()
 
static void initializeInstance (const Ptr &instance)
 

Protected Member Functions

virtual void registerCmd (const UndoableCommand::Ptr &cmd) const
 The method registers the command (i.e. without executing it) to the undo queue. More...
 
 UndoableCommandMgr ()
 Only derived classes can create an undoable command manager. More...
 

Friends

class UndoableCommandGuard
 

Detailed Description

Abstract base class for undoable command manager.

Certain UFE clients will make changes to a data model by using Ufe::UndoableCommand and want those changes to generate application-level undoable commands. This singleton class allows an application to provide this functionality by registering a concrete implementation of UndableCommandMgr.

If the application doesn't support an undo queue, the concrete implementation only has to execute the command which is the default behaviour of the class.

Note that there will be only one instance of the undoable command manager in the application.

Definition at line 34 of file undoableCommandMgr.h.

Member Typedef Documentation

◆ Ptr

Definition at line 38 of file undoableCommandMgr.h.

Constructor & Destructor Documentation

◆ UndoableCommandMgr() [1/2]

Ufe::UndoableCommandMgr::UndoableCommandMgr ( const UndoableCommandMgr )
delete

Constructors.

◆ ~UndoableCommandMgr()

virtual Ufe::UndoableCommandMgr::~UndoableCommandMgr ( )
virtual

Destructor.

◆ UndoableCommandMgr() [2/2]

Ufe::UndoableCommandMgr::UndoableCommandMgr ( )
protected

Only derived classes can create an undoable command manager.

Member Function Documentation

◆ executeCmd()

virtual void Ufe::UndoableCommandMgr::executeCmd ( const UndoableCommand::Ptr cmd) const
virtual

The method directly executes the command i.e., not undoable execution.

Note
The application implementation should execute the command and add it in its undo queue mechanism if it exists; otherwise, it can use the default implementation.

◆ initializeInstance()

static void Ufe::UndoableCommandMgr::initializeInstance ( const Ptr instance)
static

Initialize the command manager singleton. The application should call this once at startup to initialize the instance and once at shut down for clean-up.

Parameters
instanceThe command manager instance or null to remove the existing instance.
Exceptions
std::invalid_argumentif the instance is initialized with a non-null pointer more than once.

◆ instance()

static UndoableCommandMgr & Ufe::UndoableCommandMgr::instance ( )
static
Returns
The command manager singleton instance.

◆ operator=()

UndoableCommandMgr & Ufe::UndoableCommandMgr::operator= ( const UndoableCommandMgr )
delete

◆ registerCmd()

virtual void Ufe::UndoableCommandMgr::registerCmd ( const UndoableCommand::Ptr cmd) const
protectedvirtual

The method registers the command (i.e. without executing it) to the undo queue.

Note
The application implementation should only register the command to its undo queue mechanism if it exists; otherwise, it does nothing. The command is not executed.

Friends And Related Function Documentation

◆ UndoableCommandGuard

friend class UndoableCommandGuard
friend

Definition at line 65 of file undoableCommandMgr.h.


The documentation for this class was generated from the following file: