ProgramInterface Class Reference

#include <rtt/ProgramInterface.hpp>

Inheritance diagram for ProgramInterface:

FunctionGraph

List of all members.


Detailed Description

A Program represents a collection of instructions that can be stepwise executed.

Definition at line 58 of file ProgramInterface.hpp.


Public Member Functions

 ProgramInterface (ProgramProcessor *progp=0)
void setProgramProcessor (ProgramProcessor *progp)
ProgramProcessorgetProgramProcessor () const
virtual bool start ()=0
 Start the execution of this program.
virtual bool pause ()=0
 Pause or start-and-pause the execution of this program.
virtual bool step ()=0
 Execute a single action when paused.
virtual bool stop ()=0
 Stop the execution of this program.
virtual bool execute ()=0
 Execute as much actions until the program needs to wait on a condition to become true.
virtual void reset ()=0
 Reset the execution point to the beginning of this program interface.
bool isRunning () const
 Returns true if the program is running.
bool isPaused () const
 Returns true if the program is paused.
bool isStopped () const
 Returns true if the program is not executing (stopped) or not loaded.
bool inError () const
 Returns true if the program is in error.
virtual bool stepDone () const =0
virtual int getLineNumber () const =0
 Return the current 'line number' of the program.
Status::ProgramStatus getStatus () const
 Return the current status of the program.
virtual std::string getText () const =0
 Return the program text to which getLineNumber() refers.
virtual const std::string & getName () const =0
 Programs can be refered to by name.
virtual std::vector
< AttributeBase * > 
getArguments () const =0
 Get the argument list of this program.
virtual ProgramInterfacecopy (std::map< const DataSourceBase *, DataSourceBase * > &replacementdss) const =0
 Clone this Program.
virtual ProgramInterfaceclone () const =0

Protected Member Functions

virtual void handleUnload ()

Protected Attributes

Status::ProgramStatus pStatus
ProgramProcessorpp

Classes

struct  Status
 Placeholder of the ProgramStatus. More...

Member Function Documentation

virtual bool execute (  )  [pure virtual]

Execute as much actions until the program needs to wait on a condition to become true.

When paused, only execute one action.

Returns:
false if a program error occured.

Implemented in FunctionGraph.

Referenced by StateMachine::pause(), and ProgramProcessor::step().

virtual ProgramInterface* copy ( std::map< const DataSourceBase *, DataSourceBase * > &  replacementdss  )  const [pure virtual]

Clone this Program.

This will produce a completely new instance, that has nothing in common with this one. It takes care to properly map identical DataSources to identical DataSources.

Parameters:
alreadyMappedData A map of some DataSources used in this program to new DataSources that should replace them in the new Program. This is provided, because in some cases the outside world also keeps references to datasources used somewhere in this programgraph. It is then important that when this Program is copied, the outside world has a way to get a reference to the corresponding datasources in the new program. We do this by allowing it to map some datasources itself, and simply provide us a list of its mappings.

Implemented in FunctionGraph.


The documentation for this class was generated from the following files:

Generated on Mon Jan 19 16:53:58 2009 for OrocosReal-TimeToolkit by  doxygen 1.5.6