Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

TSE3::Cmd::CommandGroup Class Reference

Group of commands Command. More...

#include <CommandGroup.h>

Inheritance diagram for TSE3::Cmd::CommandGroup:

Inheritance graph
[legend]
Collaboration diagram for TSE3::Cmd::CommandGroup:

Collaboration graph
[legend]
List of all members.

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 ()

Detailed Description

Group of commands Command.

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.

Author:
Pete Goodliffe
Version:
3.00


Constructor & Destructor Documentation

TSE3::Cmd::CommandGroup::CommandGroup const std::string &  title = ""  ) 
 

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

virtual TSE3::Cmd::CommandGroup::~CommandGroup  )  [virtual]
 


Member Function Documentation

void TSE3::Cmd::CommandGroup::add Command command  ) 
 

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 TSE3::Cmd::CommandGroup::size  )  const [inline]
 

Returns the number of Command objects that have been added to this CommandGroup (see add).

Returns:
Number of Command objects in this CommandGroup

virtual void TSE3::Cmd::CommandGroup::executeImpl  )  [protected, virtual]
 

Implements TSE3::Cmd::Command.

virtual void TSE3::Cmd::CommandGroup::undoImpl  )  [protected, virtual]
 

Implements TSE3::Cmd::Command.


The documentation for this class was generated from the following file:
Generated on Wed May 25 14:47:34 2005 for TSE3 by doxygen 1.3.2