CmdManager (object)

The command manager contains and manages the command undo-redo stack.

The command manager follows this pattern : http://kapo-cpp.blogspot.ca/2007/10/multilevel-undo-with-command-pattern.html

CmdManager CmdManager CmdManager

Members

Cmd[] undoStack Array of undo commands
Cmd[] redoStack Array of redo commands

Methods

  CmdManager ( in CmdManager other )
  CmdManager ()
  clearRedoStack ! ()
CmdManager clone ? ()
Boolean exec ! ( io Cmd cmd )
Ref<Cmd> getCmdInUndoStack ? ( in Index index )
Size getNumCmdInUndoStack ? ()
Ref<CmdManager> getOrCreateCmdManager ? ()
Boolean redo ! ()
Boolean undo ! ()

Methods in detail

CmdManager ( in CmdManager other )

copy constructor


CmdManager ()

default constructor


CmdManager.clearRedoStack! ()

Clear the stack.


CmdManager CmdManager.clone? ()

clone method


Boolean CmdManager.exec! ( io Cmd cmd )

Executes a command and adds it to the stack.

cmd The command to execute


Ref<Cmd> CmdManager.getCmdInUndoStack? ( in Index index )

Gets a reference to command at index.

index The index of the command in the stack


Size CmdManager.getNumCmdInUndoStack? ()

Gets the number of commands within the stack.


Ref<CmdManager> CmdManager.getOrCreateCmdManager? ()

Gets the CmdManager singleton, or constructs it if it didn’t exist.


Boolean CmdManager.redo! ()

Redoes the command stack.


Boolean CmdManager.undo! ()

Undoes the command stack.