Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members

MProcessComposite Class Reference

A composite process. More...

#include <MProcessComposite.h>

Inheritance diagram for MProcessComposite:

MProcess List of all members.

Public Member Functions

 MProcessComposite (string name)
virtual MProcessChild (const unsigned int n) const
virtual unsigned int NumberOfChildren () const
virtual void Run (const unsigned int n)
virtual void AddChild (MProcess *child)
virtual void RemoveChild (const unsigned int n)
virtual void InsertChild (MProcess *child, const unsigned int n)
virtual void MoveChild (const unsigned int n, const unsigned int m)

Protected Attributes

vector< MProcess * > _children

Detailed Description

A composite process is composed of several children processes. Running a composite process will run in turn each of its children processes.


Constructor & Destructor Documentation

MProcessComposite::MProcessComposite string  name  )  [inline]
 

Creates a composite process called name and having no children.


Member Function Documentation

MProcess * MProcessComposite::Child const unsigned int  n  )  const [virtual]
 

The nth direct child of the process.

Precondition:
n < NumberOfChildren( )
Postcondition:
result != NULL

Reimplemented from MProcess.

unsigned int MProcessComposite::NumberOfChildren  )  const [virtual]
 

The number of direct children of the process.

Reimplemented from MProcess.

void MProcessComposite::Run const unsigned int  n  )  [virtual]
 

Calls MProcess::Run( n ) on each child in order.

Implements MProcess.

void MProcessComposite::AddChild MProcess child  )  [virtual]
 

Adds a child process after the current last child.

Precondition:
Child( NumberOfChildren( ) - 1 ) == child
Postcondition:
NumberOfChildren( ) == old NumberOfChildren( ) + 1

void MProcessComposite::RemoveChild const unsigned int  n  )  [virtual]
 

Removes the nth child process.

This does not delete the child process object.

Precondition:
n < NumberOfChildren( )
Postcondition:
NumberOfChildren( ) = old NumberOfChildren( ) - 1

void MProcessComposite::InsertChild MProcess child,
const unsigned int  n
[virtual]
 

Inserts a child child at position n.

Precondition:
n <= NumberOfChildren( )
Postcondition:
Child( n ) == child

NumberOfChildren( ) = old NumberOfChildren( ) + 1

void MProcessComposite::MoveChild const unsigned int  n,
const unsigned int  m
[virtual]
 

Moves the child at position n to position m.

Precondition:
n < NumberOfChildren( )

m < NumberOfChildren( )

Postcondition:
old Child( n ) == Child( m )

Member Data Documentation

vector< MProcess * > MProcessComposite::_children [protected]
 

The children of the composite process.


The documentation for this class was generated from the following files:
Generated on Mon Jan 31 12:43:32 2005 for la Marmite by Doxygen 1.4.1