#include <CommandGroup.h>
Inheritance diagram for TSE3::Cmd::CommandGroup:
Public Member Functions | |
CommandGroup (const std::string &title="") | |
virtual | ~CommandGroup () |
void | add (Command *command) |
size_t | size () const |
Protected Member Functions | |
virtual void | executeImpl () |
virtual void | undoImpl () |
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.
|
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.
|
|
|
|
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.
|
|
Returns the number of Command objects that have been added to this CommandGroup (see add).
|
|
Implements TSE3::Cmd::Command. |
|
Implements TSE3::Cmd::Command. |