A Program represents a collection of instructions that can be stepwise executed. More...
#include <rtt/ProgramInterface.hpp>
Classes | |
struct | Status |
Placeholder of the ProgramStatus. More... | |
Public Member Functions | |
ProgramInterface (ProgramProcessor *progp=0) | |
void | setProgramProcessor (ProgramProcessor *progp) |
ProgramProcessor * | getProgramProcessor () 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 ProgramInterface * | copy (std::map< const DataSourceBase *, DataSourceBase * > &replacementdss) const =0 |
Clone this Program. | |
virtual ProgramInterface * | clone () const =0 |
Protected Member Functions | |
virtual void | handleUnload () |
Protected Attributes | |
Status::ProgramStatus | pStatus |
ProgramProcessor * | pp |
A Program represents a collection of instructions that can be stepwise executed.
Definition at line 58 of file ProgramInterface.hpp.
virtual ProgramInterface* RTT::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.
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 RTT::FunctionGraph.
virtual bool RTT::ProgramInterface::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.
Implemented in RTT::FunctionGraph.