#include <FunctionGraph.hpp>
Public Types | |
typedef boost::graph_traits < Graph >::edge_descriptor | Edge |
typedef boost::graph_traits < Graph >::edge_descriptor | Edge |
typedef EdgeCondition::EdgeProperty | EdgeProperty |
typedef EdgeCondition::EdgeProperty | EdgeProperty |
typedef boost::adjacency_list < boost::vecS, boost::listS, boost::directedS, VertProperty, EdgeProperty > | Graph |
typedef boost::adjacency_list < boost::vecS, boost::listS, boost::directedS, VertProperty, EdgeProperty > | Graph |
typedef boost::graph_traits < Graph >::vertex_descriptor | Vertex |
typedef boost::graph_traits < Graph >::vertex_descriptor | Vertex |
typedef VertexNode::VertProperty | VertProperty |
typedef VertexNode::VertProperty | VertProperty |
Public Member Functions | |
void | addArgument (base::AttributeBase *a) |
void | addArgument (base::AttributeBase *a) |
void | clearArguments () |
void | clearArguments () |
virtual FunctionGraph * | clone () const |
virtual FunctionGraph * | clone () const |
virtual FunctionGraph * | copy (std::map< const base::DataSourceBase *, base::DataSourceBase * > &replacementdss) const |
virtual FunctionGraph * | copy (std::map< const base::DataSourceBase *, base::DataSourceBase * > &replacementdss) const |
Vertex | currentNode () const |
Vertex | currentNode () const |
void | debugPrintout () const |
void | debugPrintout () const |
virtual bool | execute () |
virtual bool | execute () |
Vertex | exitNode () const |
Vertex | exitNode () const |
void | finish () |
void | finish () |
FunctionGraph (const FunctionGraph &orig) | |
FunctionGraph (const std::string &name, bool unload_on_stop) | |
FunctionGraph (const FunctionGraph &orig) | |
FunctionGraph (const std::string &name, bool unload_on_stop) | |
std::vector < base::AttributeBase * > | getArguments () const |
std::vector < base::AttributeBase * > | getArguments () const |
Graph & | getGraph () |
const Graph & | getGraph () const |
Graph & | getGraph () |
const Graph & | getGraph () const |
virtual int | getLineNumber () const |
virtual int | getLineNumber () const |
virtual const std::string & | getName () const |
virtual const std::string & | getName () const |
base::AttributeBase * | getResult () const |
base::AttributeBase * | getResult () const |
std::string | getText () const |
std::string | getText () const |
virtual void | loading () |
virtual void | loading () |
virtual bool | pause () |
virtual bool | pause () |
Vertex | previousNode () const |
Vertex | previousNode () const |
virtual void | reset () |
virtual void | reset () |
void | setName (const std::string &_name) |
void | setName (const std::string &_name) |
void | setProgramService (ServicePtr myservice) |
void | setProgramService (ServicePtr myservice) |
void | setResult (base::AttributeBase *r) |
void | setResult (base::AttributeBase *r) |
void | setText (const std::string &t) |
void | setText (const std::string &t) |
void | setUnloadOnStop (bool unload_on_stop) |
void | setUnloadOnStop (bool unload_on_stop) |
virtual bool | start () |
virtual bool | start () |
Vertex | startNode () const |
Vertex | startNode () const |
virtual bool | step () |
virtual bool | step () |
virtual bool | stepDone () const |
virtual bool | stepDone () const |
virtual bool | stop () |
virtual bool | stop () |
virtual void | unloading () |
virtual void | unloading () |
~FunctionGraph () | |
~FunctionGraph () | |
Protected Member Functions | |
bool | executeStep () |
bool | executeStep () |
bool | executeUntil () |
bool | executeUntil () |
Protected Attributes | |
std::string | _text |
std::vector < base::AttributeBase * > | args |
ServicePtr | context |
Vertex | exitv |
bool | mstep |
bool | munload_on_stop |
std::string | myName |
bool | pausing |
Graph | program |
base::AttributeBase * | retn |
Vertex | startv |
Private Attributes | |
Vertex | current |
Vertex | previous |
This class represents a function. It has much in common with a program but is only used for storing a Graph.
Definition at line 54 of file install/include/rtt/scripting/FunctionGraph.hpp.
typedef boost::graph_traits<Graph>::edge_descriptor RTT::scripting::FunctionGraph::Edge |
Definition at line 72 of file rtt/scripting/FunctionGraph.hpp.
typedef boost::graph_traits<Graph>::edge_descriptor RTT::scripting::FunctionGraph::Edge |
Definition at line 67 of file install/include/rtt/scripting/FunctionGraph.hpp.
Definition at line 63 of file rtt/scripting/FunctionGraph.hpp.
Definition at line 58 of file install/include/rtt/scripting/FunctionGraph.hpp.
typedef boost::adjacency_list<boost::vecS, boost::listS, boost::directedS, VertProperty, EdgeProperty> RTT::scripting::FunctionGraph::Graph |
Definition at line 70 of file rtt/scripting/FunctionGraph.hpp.
typedef boost::adjacency_list<boost::vecS, boost::listS, boost::directedS, VertProperty, EdgeProperty> RTT::scripting::FunctionGraph::Graph |
Definition at line 65 of file install/include/rtt/scripting/FunctionGraph.hpp.
typedef boost::graph_traits<Graph>::vertex_descriptor RTT::scripting::FunctionGraph::Vertex |
Definition at line 71 of file rtt/scripting/FunctionGraph.hpp.
typedef boost::graph_traits<Graph>::vertex_descriptor RTT::scripting::FunctionGraph::Vertex |
Definition at line 66 of file install/include/rtt/scripting/FunctionGraph.hpp.
Definition at line 64 of file rtt/scripting/FunctionGraph.hpp.
Definition at line 59 of file install/include/rtt/scripting/FunctionGraph.hpp.
RTT::FunctionGraph::FunctionGraph | ( | const std::string & | name, | |
bool | unload_on_stop | |||
) |
Create a FunctionGraph with a given name.
name | The name of this script. | |
unload_on_stop | Set to true to force an unload when the script stops or an error is encountered. The unload is forced by returning false in execute(), as defined in the ExecutableInterface. This flag should only be set to true for scripts that don't have a service associated (see setProgramService() ), since the service is destroyed when the function is unloaded. You can override this behavior after construction by using setUnloadOnStop(). |
Definition at line 50 of file FunctionGraph.cpp.
RTT::FunctionGraph::FunctionGraph | ( | const FunctionGraph & | orig | ) |
Copy a FunctionGraph.
Definition at line 60 of file FunctionGraph.cpp.
RTT::FunctionGraph::~FunctionGraph | ( | ) |
Definition at line 105 of file FunctionGraph.cpp.
RTT::scripting::FunctionGraph::FunctionGraph | ( | const std::string & | name, | |
bool | unload_on_stop | |||
) |
Create a FunctionGraph with a given name.
name | The name of this script. | |
unload_on_stop | Set to true to force an unload when the script stops or an error is encountered. The unload is forced by returning false in execute(), as defined in the ExecutableInterface. This flag should only be set to true for scripts that don't have a service associated (see setProgramService() ), since the service is destroyed when the function is unloaded. You can override this behavior after construction by using setUnloadOnStop(). |
RTT::scripting::FunctionGraph::FunctionGraph | ( | const FunctionGraph & | orig | ) |
Copy a FunctionGraph.
RTT::scripting::FunctionGraph::~FunctionGraph | ( | ) |
void RTT::scripting::FunctionGraph::addArgument | ( | base::AttributeBase * | a | ) | [inline] |
Definition at line 240 of file rtt/scripting/FunctionGraph.hpp.
void RTT::scripting::FunctionGraph::addArgument | ( | base::AttributeBase * | a | ) | [inline] |
Definition at line 235 of file install/include/rtt/scripting/FunctionGraph.hpp.
void RTT::scripting::FunctionGraph::clearArguments | ( | ) |
Clear the arguments vector and release all base::AttributeBase resources.
void RTT::FunctionGraph::clearArguments | ( | ) |
Clear the arguments vector and release all base::AttributeBase resources.
Definition at line 449 of file FunctionGraph.cpp.
virtual FunctionGraph* RTT::scripting::FunctionGraph::clone | ( | ) | const [virtual] |
Implements RTT::scripting::ProgramInterface.
FunctionGraph * RTT::FunctionGraph::clone | ( | ) | const [virtual] |
Implements RTT::scripting::ProgramInterface.
Definition at line 422 of file FunctionGraph.cpp.
virtual FunctionGraph* RTT::scripting::FunctionGraph::copy | ( | std::map< const base::DataSourceBase *, base::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::scripting::ProgramInterface.
virtual FunctionGraph* RTT::scripting::FunctionGraph::copy | ( | std::map< const base::DataSourceBase *, base::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::scripting::ProgramInterface.
Vertex RTT::scripting::FunctionGraph::currentNode | ( | ) | const [inline] |
Definition at line 204 of file rtt/scripting/FunctionGraph.hpp.
Vertex RTT::scripting::FunctionGraph::currentNode | ( | ) | const [inline] |
Definition at line 199 of file install/include/rtt/scripting/FunctionGraph.hpp.
void RTT::scripting::FunctionGraph::debugPrintout | ( | ) | const |
void RTT::FunctionGraph::debugPrintout | ( | ) | const |
Definition at line 427 of file FunctionGraph.cpp.
virtual bool RTT::scripting::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.
Implements RTT::scripting::ProgramInterface.
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.
Implements RTT::scripting::ProgramInterface.
Definition at line 190 of file FunctionGraph.cpp.
bool RTT::scripting::FunctionGraph::executeStep | ( | ) | [protected] |
bool RTT::FunctionGraph::executeStep | ( | ) | [protected] |
Definition at line 280 of file FunctionGraph.cpp.
bool RTT::scripting::FunctionGraph::executeUntil | ( | ) | [protected] |
bool RTT::FunctionGraph::executeUntil | ( | ) | [protected] |
Definition at line 220 of file FunctionGraph.cpp.
Vertex RTT::scripting::FunctionGraph::exitNode | ( | ) | const [inline] |
Definition at line 214 of file rtt/scripting/FunctionGraph.hpp.
Vertex RTT::scripting::FunctionGraph::exitNode | ( | ) | const [inline] |
Definition at line 209 of file install/include/rtt/scripting/FunctionGraph.hpp.
void RTT::scripting::FunctionGraph::finish | ( | ) |
To be called after a function is constructed.
void RTT::FunctionGraph::finish | ( | ) |
To be called after a function is constructed.
Definition at line 85 of file FunctionGraph.cpp.
std::vector<base::AttributeBase*> RTT::scripting::FunctionGraph::getArguments | ( | ) | const [inline, virtual] |
Return an ordered list of this funcion's arguments.
Implements RTT::scripting::ProgramInterface.
Definition at line 232 of file rtt/scripting/FunctionGraph.hpp.
std::vector<base::AttributeBase*> RTT::scripting::FunctionGraph::getArguments | ( | ) | const [inline, virtual] |
Return an ordered list of this funcion's arguments.
Implements RTT::scripting::ProgramInterface.
Definition at line 227 of file install/include/rtt/scripting/FunctionGraph.hpp.
Graph& RTT::scripting::FunctionGraph::getGraph | ( | ) | [inline] |
Definition at line 224 of file rtt/scripting/FunctionGraph.hpp.
const Graph& RTT::scripting::FunctionGraph::getGraph | ( | ) | const [inline] |
Definition at line 219 of file rtt/scripting/FunctionGraph.hpp.
Graph& RTT::scripting::FunctionGraph::getGraph | ( | ) | [inline] |
Definition at line 219 of file install/include/rtt/scripting/FunctionGraph.hpp.
const Graph& RTT::scripting::FunctionGraph::getGraph | ( | ) | const [inline] |
Definition at line 214 of file install/include/rtt/scripting/FunctionGraph.hpp.
virtual int RTT::scripting::FunctionGraph::getLineNumber | ( | ) | const [virtual] |
Return the current 'line number' of the program.
Implements RTT::scripting::ProgramInterface.
int RTT::FunctionGraph::getLineNumber | ( | ) | const [virtual] |
Return the current 'line number' of the program.
Implements RTT::scripting::ProgramInterface.
Definition at line 368 of file FunctionGraph.cpp.
virtual const std::string& RTT::scripting::FunctionGraph::getName | ( | ) | const [virtual] |
Programs can be refered to by name.
Implements RTT::scripting::ProgramInterface.
const std::string & RTT::FunctionGraph::getName | ( | ) | const [virtual] |
Programs can be refered to by name.
Implements RTT::scripting::ProgramInterface.
Definition at line 348 of file FunctionGraph.cpp.
base::AttributeBase* RTT::scripting::FunctionGraph::getResult | ( | ) | const [inline, virtual] |
Get the return value of this program.
Implements RTT::scripting::ProgramInterface.
Definition at line 236 of file rtt/scripting/FunctionGraph.hpp.
base::AttributeBase* RTT::scripting::FunctionGraph::getResult | ( | ) | const [inline, virtual] |
Get the return value of this program.
Implements RTT::scripting::ProgramInterface.
Definition at line 231 of file install/include/rtt/scripting/FunctionGraph.hpp.
std::string RTT::scripting::FunctionGraph::getText | ( | ) | const [virtual] |
Return the program text to which getLineNumber() refers.
Implements RTT::scripting::ProgramInterface.
std::string RTT::FunctionGraph::getText | ( | ) | const [virtual] |
Return the program text to which getLineNumber() refers.
Implements RTT::scripting::ProgramInterface.
Definition at line 358 of file FunctionGraph.cpp.
virtual void RTT::scripting::FunctionGraph::loading | ( | ) | [virtual] |
Informs this object that it got loaded in an ExecutionEngine. Called by load() after the engine pointer is set.
Reimplemented from RTT::base::ExecutableInterface.
void RTT::FunctionGraph::loading | ( | ) | [virtual] |
Informs this object that it got loaded in an ExecutionEngine. Called by load() after the engine pointer is set.
Reimplemented from RTT::base::ExecutableInterface.
Definition at line 127 of file FunctionGraph.cpp.
virtual bool RTT::scripting::FunctionGraph::pause | ( | ) | [virtual] |
Pause or start-and-pause the execution of this program.
Implements RTT::scripting::ProgramInterface.
bool RTT::FunctionGraph::pause | ( | ) | [virtual] |
Pause or start-and-pause the execution of this program.
Implements RTT::scripting::ProgramInterface.
Definition at line 164 of file FunctionGraph.cpp.
Vertex RTT::scripting::FunctionGraph::previousNode | ( | ) | const [inline] |
Definition at line 209 of file rtt/scripting/FunctionGraph.hpp.
Vertex RTT::scripting::FunctionGraph::previousNode | ( | ) | const [inline] |
Definition at line 204 of file install/include/rtt/scripting/FunctionGraph.hpp.
virtual void RTT::scripting::FunctionGraph::reset | ( | ) | [virtual] |
Identical to stop();
Implements RTT::scripting::ProgramInterface.
void RTT::FunctionGraph::reset | ( | ) | [virtual] |
Identical to stop();
Implements RTT::scripting::ProgramInterface.
Definition at line 335 of file FunctionGraph.cpp.
void RTT::scripting::FunctionGraph::setName | ( | const std::string & | _name | ) |
Set the name of this program. Only valid before endProgram() is called.
void RTT::FunctionGraph::setName | ( | const std::string & | _name | ) |
Set the name of this program. Only valid before endProgram() is called.
Definition at line 353 of file FunctionGraph.cpp.
void RTT::scripting::FunctionGraph::setProgramService | ( | ServicePtr | myservice | ) |
Set a service that manages this script. The service will be destroyed when this function is unloaded.
void RTT::FunctionGraph::setProgramService | ( | ServicePtr | myservice | ) |
Set a service that manages this script. The service will be destroyed when this function is unloaded.
Definition at line 117 of file FunctionGraph.cpp.
void RTT::scripting::FunctionGraph::setResult | ( | base::AttributeBase * | r | ) | [inline] |
Will store the result in this attribute.
Definition at line 247 of file rtt/scripting/FunctionGraph.hpp.
void RTT::scripting::FunctionGraph::setResult | ( | base::AttributeBase * | r | ) | [inline] |
Will store the result in this attribute.
Definition at line 242 of file install/include/rtt/scripting/FunctionGraph.hpp.
void RTT::scripting::FunctionGraph::setText | ( | const std::string & | t | ) |
Set the program text.
void RTT::FunctionGraph::setText | ( | const std::string & | t | ) |
Set the program text.
Definition at line 363 of file FunctionGraph.cpp.
void RTT::scripting::FunctionGraph::setUnloadOnStop | ( | bool | unload_on_stop | ) |
Sets the unloading policy on stop or error.
unload_on_stop | See the description of the constructor of this class. |
void RTT::FunctionGraph::setUnloadOnStop | ( | bool | unload_on_stop | ) |
Sets the unloading policy on stop or error.
unload_on_stop | See the description of the constructor of this class. |
Definition at line 122 of file FunctionGraph.cpp.
virtual bool RTT::scripting::FunctionGraph::start | ( | ) | [virtual] |
Start the execution of this program.
Implements RTT::scripting::ProgramInterface.
bool RTT::FunctionGraph::start | ( | ) | [virtual] |
Start the execution of this program.
Implements RTT::scripting::ProgramInterface.
Definition at line 150 of file FunctionGraph.cpp.
Vertex RTT::scripting::FunctionGraph::startNode | ( | ) | const [inline] |
Definition at line 199 of file rtt/scripting/FunctionGraph.hpp.
Vertex RTT::scripting::FunctionGraph::startNode | ( | ) | const [inline] |
Definition at line 194 of file install/include/rtt/scripting/FunctionGraph.hpp.
virtual bool RTT::scripting::FunctionGraph::step | ( | ) | [virtual] |
Execute a single action when paused.
Implements RTT::scripting::ProgramInterface.
bool RTT::FunctionGraph::step | ( | ) | [virtual] |
Execute a single action when paused.
Implements RTT::scripting::ProgramInterface.
Definition at line 176 of file FunctionGraph.cpp.
virtual bool RTT::scripting::FunctionGraph::stepDone | ( | ) | const [virtual] |
Implements RTT::scripting::ProgramInterface.
bool RTT::FunctionGraph::stepDone | ( | ) | const [virtual] |
Implements RTT::scripting::ProgramInterface.
Definition at line 185 of file FunctionGraph.cpp.
virtual bool RTT::scripting::FunctionGraph::stop | ( | ) | [virtual] |
Stop the execution of this program.
Implements RTT::scripting::ProgramInterface.
bool RTT::FunctionGraph::stop | ( | ) | [virtual] |
Stop the execution of this program.
Implements RTT::scripting::ProgramInterface.
Definition at line 341 of file FunctionGraph.cpp.
virtual void RTT::scripting::FunctionGraph::unloading | ( | ) | [virtual] |
Informs this object that it got unloaded from an ExecutionEngine. Called by unload() before the engine pointer is cleared.
Reimplemented from RTT::base::ExecutableInterface.
void RTT::FunctionGraph::unloading | ( | ) | [virtual] |
Informs this object that it got unloaded from an ExecutionEngine. Called by unload() before the engine pointer is cleared.
Reimplemented from RTT::base::ExecutableInterface.
Definition at line 134 of file FunctionGraph.cpp.
std::string RTT::scripting::FunctionGraph::_text [protected] |
Program text.
Definition at line 97 of file install/include/rtt/scripting/FunctionGraph.hpp.
std::vector< base::AttributeBase * > RTT::scripting::FunctionGraph::args [protected] |
Ordered arguments (are also in the repository).
Definition at line 102 of file install/include/rtt/scripting/FunctionGraph.hpp.
ServicePtr RTT::scripting::FunctionGraph::context [protected] |
Definition at line 113 of file install/include/rtt/scripting/FunctionGraph.hpp.
Vertex RTT::scripting::FunctionGraph::current [private] |
The node which is executed now
Definition at line 73 of file install/include/rtt/scripting/FunctionGraph.hpp.
Vertex RTT::scripting::FunctionGraph::exitv [protected] |
Definition at line 87 of file install/include/rtt/scripting/FunctionGraph.hpp.
bool RTT::scripting::FunctionGraph::mstep [protected] |
Definition at line 107 of file install/include/rtt/scripting/FunctionGraph.hpp.
bool RTT::scripting::FunctionGraph::munload_on_stop [protected] |
Definition at line 108 of file install/include/rtt/scripting/FunctionGraph.hpp.
std::string RTT::scripting::FunctionGraph::myName [protected] |
The (unique) name of this program.
Definition at line 92 of file install/include/rtt/scripting/FunctionGraph.hpp.
bool RTT::scripting::FunctionGraph::pausing [protected] |
Definition at line 106 of file install/include/rtt/scripting/FunctionGraph.hpp.
The node that was run before this one.
Definition at line 78 of file install/include/rtt/scripting/FunctionGraph.hpp.
Graph RTT::scripting::FunctionGraph::program [protected] |
The graph containing this function.
Definition at line 84 of file install/include/rtt/scripting/FunctionGraph.hpp.
base::AttributeBase * RTT::scripting::FunctionGraph::retn [protected] |
Definition at line 104 of file install/include/rtt/scripting/FunctionGraph.hpp.
Vertex RTT::scripting::FunctionGraph::startv [protected] |
Definition at line 86 of file install/include/rtt/scripting/FunctionGraph.hpp.