Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

RS::Plan Class Reference

Used to represent a plan. More...

List of all members.

Public Member Functions

 Plan (const Step &step=Step())
 The default constructor.

 Plan (const Plan &obj)
 The copy constructor.

virtual ~Plan ()
 The destructor.

Plan & operator= (const Plan &obj)
 The assignment operator.

Plan & addStep (const Step &step)
 Add a step to the plan.

Step getNextStep () const
 Get the first step in the plan.

Plan & removeNextStep ()
 Remove the first step in the plan.

Step getLastStep () const
 Get the last step in the plan.

Plan & removeLastStep ()
 Remove the last step in the plan.

bool empty () const
 Test if the plan contains no steps.

Plan & makeEmpty ()
 Removes all the steps stored in the plan.


Protected Member Functions

bool invariant () const
 Test the class invariant.


Detailed Description

Used to represent a plan.

A Plan is a sequence of Step. The steps in the plans are stored in a deque (dubbel ended queu), in order to have fast insertion at the back of the sequence, fast deletion at the top of the sequence and at the same time have random access to all element, for algortihms to work on plans as sequences.

Todo:
The current implementation of Step and Plan will probably lead to a lot of copying of commands. This might be a problem. If it is the plan should take step pointers as arguments and own them.
Unit:
Library
Revision
1.5
Author
s02davro
Date
2002/08/31 14:57:59

Definition at line 92 of file Plan.h.


Constructor & Destructor Documentation

RS::Plan::Plan const Step   step = Step()
 

The default constructor.

If step is empty then create an empty plan, othwerwise a plan containing the step step.

Definition at line 63 of file Plan.cc.

References addStep(), and RS_CHECK_INVARIANT.

RS::Plan::Plan const Plan &    obj
 

The copy constructor.

Parameters:
obj is the object to be copied.
Postcondition:
The constructed object is an exact copy of obj.

Definition at line 71 of file Plan.cc.

References RS_CHECK_INVARIANT.


Member Function Documentation

Plan & RS::Plan::operator= const Plan &    obj
 

The assignment operator.

Parameters:
obj is the object to be assigned from.
Returns:
A reference to the the newly assigned object.
Postcondition:
The object is an exact copy of obj.

Definition at line 90 of file Plan.cc.

References makeEmpty(), RS_CHECK_INVARIANT, and stepSequence.

Plan & RS::Plan::addStep const Step   step [inline]
 

Add a step to the plan.

If the step is empty then the plan is still empty.

Definition at line 63 of file Plan.icc.

References RS::Step::empty(), and RS_CHECK_INVARIANT.

Referenced by Plan().

Step RS::Plan::getNextStep   const
 

Get the first step in the plan.

If the plan is empty then an empty step is returned.

Definition at line 107 of file Plan.cc.

References empty(), and RS_CHECK_INVARIANT.

Referenced by RS::ActuatorInterface::getNextStep().

Step RS::Plan::getLastStep   const
 

Get the last step in the plan.

If the plan is empty then an empty step is returned.

Definition at line 119 of file Plan.cc.

References empty(), and RS_CHECK_INVARIANT.

bool RS::Plan::empty   const [inline]
 

Test if the plan contains no steps.

Returns:
true iff the plan is empty.

Definition at line 96 of file Plan.icc.

References RS_CHECK_INVARIANT.

Referenced by RS::ActuatorInterface::empty(), getLastStep(), getNextStep(), makeEmpty(), removeLastStep(), and removeNextStep().

bool RS::Plan::invariant   const [inline, protected]
 

Test the class invariant.

This function implements a test of the class invariant. It should be tested after each constructor, before each destructor, and at the end of methods that change the state of the object.

Returns:
true iff the class invariant is satisfied, otherwise false.

Definition at line 116 of file Plan.icc.


The documentation for this class was generated from the following files:
Generated on Mon Aug 29 08:22:32 2011 for RoboSoc by doxygen1.3-rc3