Provides support for maintaining a queue of recently issued commands, performing UnDo, ReDo, etc. The parent Command class supports a queue of Params changes; each entry has a clone of the previous and next Params instance associated with a change.
More...
#include <command.h>
Provides support for maintaining a queue of recently issued commands, performing UnDo, ReDo, etc. The parent Command class supports a queue of Params changes; each entry has a clone of the previous and next Params instance associated with a change.
- Author
- Alan Norton
- Version
- 3.0
- Date
- February, 2014
The Command class automatically provides the functionality needed for Undo and Redo. Each Command instance contains two ParamNode roots, corresponding to the state of the Params before and after a state change. Command instances are inserted into the Undo/Redo queue by invoking Command::CaptureStart and then Command::CaptureEnd. The CaptureStart and CaptureEnd methods are generated by the methods Params::SetValueLong(), Params::SetValueDouble(), Params::SetValueString(), so is it only necessary to directly use Command::CaptureStart() and CaptureEnd() when more than one state change occurs in a single entry of the Undo/Redo queue.
Typedef for callback functions that help during Undo and Redo
Definition at line 50 of file command.h.
virtual VAPoR::Command::~Command |
( |
| ) |
|
|
inlinevirtual |
static Params* VAPoR::Command::AdvanceQueue |
( |
| ) |
|
|
static |
Static method to go forward one position (i.e. redo) in the queue. Returns the params instance that now is current
- Returns
- Params instance that is newly current, null if we are at end of queue
static Params* VAPoR::Command::BackupQueue |
( |
| ) |
|
|
static |
Static method to go back one position (i.e. undo) in the queue. Returns the params instance that now is current
- Returns
- Params instance that is newly current, null if nothing left to backup.
static void VAPoR::Command::CaptureEnd |
( |
Command * |
pCom, |
|
|
Params * |
nextParams, |
|
|
Params * |
nextAuxParams = 0 |
|
) |
| |
|
inlinestatic |
Obtain a copy of the auxiliary params in the queue with specified rootNode Useful if additional processing is needed during Undo or Redo Note that the returned Params copy should be deleted after it is used
- Return values
-
Params* | that was "next" in the command |
Obtain a copy of the params in the queue with specified rootNode Useful if additional processing is needed during Undo or Redo Note that the returned Params copy should be deleted after it is used
- Return values
-
Params* | that was "next" in the command |
static Command* VAPoR::Command::CurrentCommand |
( |
int |
offset | ) |
|
|
inlinestatic |
static method retrieves a command from the queue, with index relative to the last executed command.
- Parameters
-
[in] | offset | position relative to last command, positive offsets were executed earlier. |
- Returns
- Command* pointer to specified command, null if invalid.
Definition at line 88 of file command.h.
References MAX_HISTORY.
string VAPoR::Command::getDescription |
( |
| ) |
|
|
inline |
Get the description associated with this command instance
- Returns
- string Description text identifying the state change of this command.
Definition at line 101 of file command.h.
static bool VAPoR::Command::isRecording |
( |
| ) |
|
|
inlinestatic |
static method to tell if commands are being inserted in the queue
Definition at line 83 of file command.h.
static void VAPoR::Command::resetCommandQueue |
( |
| ) |
|
|
static |
Static method to put command queue in initial state.
void VAPoR::Command::setDescription |
( |
const char * |
str | ) |
|
|
inline |
Specify the description of a command
- Parameters
-
Definition at line 96 of file command.h.
The documentation for this class was generated from the following file:
- /Users/clyne/src/vapor-3.0/lib/params/command.h