Orocos Real-Time Toolkit 2.6.0
This class represents a function. More...
< boost::vecS, boost::listS,
< Graph >::vertex_descriptor
< Graph >::edge_descriptor
|FunctionGraph (const std::string &name, bool unload_on_stop)|
|Create a FunctionGraph with a given name. |
|FunctionGraph (const FunctionGraph &orig)|
|Copy a FunctionGraph. |
|void||setProgramService (ServicePtr myservice)|
|Set a service that manages this script. |
|void||setUnloadOnStop (bool unload_on_stop)|
|Sets the unloading policy on stop or error. |
|virtual bool||needsStart () const|
|Returns true if a start() is necessary when this function is loaded with ExecutionEngine::runFunction(). |
|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 void||loading ()|
|Informs this object that it got loaded in an ExecutionEngine. |
|virtual void||unloading ()|
|Informs this object that it got unloaded from an ExecutionEngine. |
|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 FunctionGraph *||copy (std::map< const base::DataSourceBase *, base::DataSourceBase * > &replacementdss) const|
|Clone this Program. |
|virtual FunctionGraph *||clone () 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||currentNode () const|
|Vertex||previousNode () const|
|Vertex||exitNode () const|
|const Graph &||getGraph () const|
|Graph &||getGraph ()|
< base::AttributeBase * >
|getArguments () const|
|Return an ordered list of this funcion's arguments. |
|base::AttributeBase *||getResult () const|
|Get the return value of this program. |
|void||addArgument (base::AttributeBase *a)|
|void||setResult (base::AttributeBase *r)|
|Will store the result in this attribute. |
|Clear the arguments vector and release all base::AttributeBase resources. |
|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. |
|void||loaded (ExecutionEngine *ee)|
|Called by the ExecutionEngine ee to tell this object it is being loaded. |
|Called by the ExecutionEngine ee to tell this object it is being unloaded. |
|Returns true if this object is loaded in an ExecutionEngine. |
|ExecutionEngine *||getEngine ()|
|Returns the ExecutionEngine this object is loaded into or null otherwise. |
|The graph containing this function. |
|The (unique) name of this program. |
|Program text. |
< base::AttributeBase * >
|Ordered arguments (are also in the repository). |
This class represents a function.
It has much in common with a program but is only used for storing a Graph.
|RTT::FunctionGraph::FunctionGraph||(||const std::string &||name,|
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().|
Referenced by copy().
|FunctionGraph * RTT::FunctionGraph::copy||(||std::map< const base::DataSourceBase *, base::DataSourceBase * > &||replacementdss||)|| const
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.|
Execute as much actions until the program needs to wait on a condition to become true.
When paused, only execute one action.
References RTT::scripting::ProgramInterface::Status::error, RTT::scripting::ProgramInterface::Status::paused, RTT::scripting::ProgramInterface::Status::running, and RTT::scripting::ProgramInterface::Status::stopped.
Called by the ExecutionEngine ee to tell this object it is being loaded.
The engine pointer is set first and the user's loading() function is called next.
|ee||The pointer to the engine calling us.|
Referenced by RTT::ExecutionEngine::runFunction().
|virtual bool RTT::scripting::FunctionGraph::needsStart||(||)|| const
Functions that unload_on_stop == true don't need to be started since they will start themselves when loaded in the EE.
|void RTT::FunctionGraph::setName||(||const std::string &||_name||)|