|
|
A class that groups Command object together so you can pretend that several commands are one.
The commands will be executed in the order that they are added to the CommandGroup (see add). They will be undone in the reverse order.
CommandGroup (const std::string &title = "")
| CommandGroup |
Creates an initially empty CommandGroup. Add Command objects with add.
You may specify a name for the group, or leave it blank. If you leave it blank then the first Command added will give its name to the CommandGroup.
Parameters:
title | Command name for CommandGroup |
~CommandGroup ()
| ~CommandGroup |
[virtual]
void add (Command *command)
| add |
Adds a Command to the group. You can keep doing this up to the first time you call Command::execute.
After the CommandGroup has been executed, this function will do nothing.
When you insert the Command you bind it's lifetime to the lifetime of this CommandGroup.
You may have already executed this command prior to inserting it, in which case it will not be run on the first CommandGroup execute. You may need to be careful when doing this to ensure you know that Commands won't interfere with one another.
Parameters:
command | New Command to add to the CommandGroup |
size_t size ()
| size |
[const]
Returns the number of Command objects that have been added to this CommandGroup (see add).
Returns: Number of Command objects in this CommandGroup
void executeImpl ()
| executeImpl |
[protected virtual]
Reimplemented from Command for internal purposes..
void undoImpl ()
| undoImpl |
[protected virtual]
Reimplemented from Command for internal purposes..