RTT::FunctionGraph Class Reference

This class represents a function. More...

#include <rtt/FunctionGraph.hpp>

Inheritance diagram for RTT::FunctionGraph:

List of all members.

Public Types

typedef EdgeCondition::EdgeProperty EdgeProperty
typedef VertexNode::VertProperty VertProperty
typedef boost::adjacency_list
< boost::vecS, boost::listS,
boost::directedS, VertProperty,
EdgeProperty > 
typedef boost::graph_traits
< Graph >::vertex_descriptor 
typedef boost::graph_traits
< Graph >::edge_descriptor 

Public Member Functions

 FunctionGraph (const std::string &_name)
 Create a FunctionGraph with a given name.
 FunctionGraph (const FunctionGraph &orig)
 Copy a FunctionGraph.
void setProgramTask (TaskObject *mytask)
void finish ()
 To be called after a function is constructed.
virtual bool start ()
 Start the execution of this program.
virtual bool execute ()
 Execute as much actions until the program needs to wait on a condition to become true.
virtual bool stop ()
 Stop the execution of this program.
virtual bool pause ()
 Pause or start-and-pause the execution of this program.
virtual bool step ()
 Execute a single action when paused.
virtual bool stepDone () const
virtual void reset ()
 Identical to stop();.
virtual int getLineNumber () const
 Return the current 'line number' of the program.
virtual const std::string & getName () const
 Programs can be refered to by name.
virtual FunctionGraphcopy (std::map< const DataSourceBase *, DataSourceBase * > &replacementdss) const
 Clone this Program.
virtual FunctionGraphclone () const
void setName (const std::string &_name)
 Set the name of this program.
void setText (const std::string &t)
 Set the program text.
std::string getText () const
 Return the program text to which getLineNumber() refers.
void debugPrintout () const
Vertex startNode () const
Vertex exitNode () const
const Graph & getGraph () const
Graph & getGraph ()
std::vector< AttributeBase * > getArguments () const
 Return an ordered list of this funcion's arguments.
void addArgument (AttributeBase *a)
void clearArguments ()
 Clear the arguments vector and release all AttributeBase resources.
void setProgramProcessor (ProgramProcessor *progp)
ProgramProcessorgetProgramProcessor () const
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.
Status::ProgramStatus getStatus () const
 Return the current status of the program.

Protected Member Functions

bool executeUntil ()
bool executeStep ()
virtual void handleUnload ()

Protected Attributes

Graph program
 The graph containing this function.
Vertex startv
Vertex exitv
std::string myName
 The (unique) name of this program.
std::string _text
 Program text.
std::vector< AttributeBase * > args
 Ordered arguments (are also in the repository).
bool pausing
bool mstep
Status::ProgramStatus pStatus

Detailed Description

This class represents a function.

It has much in common with a program but is only used for storing a Graph.

Definition at line 55 of file FunctionGraph.hpp.

Member Function Documentation

virtual FunctionGraph* RTT::FunctionGraph::copy ( std::map< const DataSourceBase *, DataSourceBase * > &  replacementdss  )  const [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.

Implements RTT::ProgramInterface.

virtual bool RTT::FunctionGraph::execute (  )  [virtual]

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

When paused, only execute one action.

false if a program error occured.

Implements RTT::ProgramInterface.

void RTT::FunctionGraph::setName ( const std::string &  _name  ) 

Set the name of this program.

Only valid before endProgram() is called.

The documentation for this class was generated from the following file:
Generated on Thu Dec 23 13:22:43 2010 for Orocos Real-Time Toolkit by  doxygen 1.6.3