Orocos Real-Time Toolkit
2.9.0
|
An action which calls a FunctionFraph for execution in a ExecutionEngine. More...
#include <rtt/scripting/CallFunction.hpp>
Public Types | |
typedef boost::shared_ptr< ActionInterface > | shared_ptr |
Use this type for shared pointer storage of an ActionInterface object. More... | |
typedef boost::shared_ptr< DisposableInterface > | shared_ptr |
Use this type for shared pointer storage of an DisposableInterface object. More... | |
Public Member Functions | |
CallFunction (base::ActionInterface *init_com, boost::shared_ptr< ProgramInterface > foo, ExecutionEngine *p, ExecutionEngine *caller) | |
Create a Command to send a function to a ExecutionEngine. More... | |
~CallFunction () | |
virtual bool | execute () |
Enqueue the function in the target engine (mrunner) and wait until it is finished or in error state. More... | |
virtual void | executeAndDispose () |
Message callback that executes the function until it finishes or yields. More... | |
virtual void | dispose () |
Just free this object without executing it. More... | |
virtual void | reset () |
Reset this action. More... | |
virtual bool | valid () const |
Inspect if this action was executed and valid. More... | |
virtual void | readArguments () |
This is invoked some time before execute() at a time when the action may read its function arguments. More... | |
base::ActionInterface * | clone () const |
The Clone Software Pattern. More... | |
base::ActionInterface * | copy (std::map< const base::DataSourceBase *, base::DataSourceBase * > &alreadyCloned) const |
When copying an Orocos program, we want identical internal::DataSource's to be mapped to identical DataSources, in order for the program to work correctly. More... | |
An action which calls a FunctionFraph for execution in a ExecutionEngine.
Script functions are always executed in the thread of the component.
Definition at line 61 of file CallFunction.hpp.
|
inherited |
Use this type for shared pointer storage of an DisposableInterface object.
Definition at line 60 of file DisposableInterface.hpp.
|
inherited |
Use this type for shared pointer storage of an ActionInterface object.
Definition at line 78 of file ActionInterface.hpp.
|
inline |
Create a Command to send a function to a ExecutionEngine.
init_com | The command to execute before sending the function into the processor, in order to initialise it. |
foo | The function to run in the processor. |
p | The target processor which will run the function. |
Definition at line 102 of file CallFunction.hpp.
|
inline |
Definition at line 112 of file CallFunction.hpp.
|
inlinevirtual |
The Clone Software Pattern.
Implements RTT::base::ActionInterface.
Definition at line 240 of file CallFunction.hpp.
|
inlinevirtual |
When copying an Orocos program, we want identical internal::DataSource's to be mapped to identical DataSources, in order for the program to work correctly.
This is different from the clone function, where we simply want a new Action that can replace the old one directly.
This function takes a map that maps the old internal::DataSource's onto their new replacements. This way, it is possible to check before cloning a internal::DataSource, whether it has already been copied, and if so, reuse the existing copy.
To keep old source working, the standard implementation of this function simply calls the clone function. If your ActionInterface uses a internal::DataSource, it is important that you reimplement this function correctly though.
Reimplemented from RTT::base::ActionInterface.
Definition at line 245 of file CallFunction.hpp.
|
inlinevirtual |
Just free this object without executing it.
Implements RTT::base::DisposableInterface.
Definition at line 225 of file CallFunction.hpp.
|
inlinevirtual |
Enqueue the function in the target engine (mrunner) and wait until it is finished or in error state.
As a first attempt the function is enqueued in the process queue of the engine (
()
Implements RTT::base::ActionInterface.
Definition at line 131 of file CallFunction.hpp.
References RTT::ExecutionEngine::isSelf(), RTT::ExecutionEngine::process(), RTT::ExecutionEngine::runFunction(), RTT::ExecutionEngine::waitForMessages(), and RTT::Warning.
|
inlinevirtual |
Message callback that executes the function until it finishes or yields.
Will be processed in the mrunner engine. If necessary, enqueue the function in the function queue for later synchronous execution if it did not finish after a single call (
()
Implements RTT::base::DisposableInterface.
Definition at line 214 of file CallFunction.hpp.
|
inlinevirtual |
This is invoked some time before execute() at a time when the action may read its function arguments.
Implements RTT::base::ActionInterface.
Definition at line 235 of file CallFunction.hpp.
|
inlinevirtual |
Reset this action.
Must be used after execute() failed.
Reimplemented from RTT::base::ActionInterface.
Definition at line 227 of file CallFunction.hpp.
|
inlinevirtual |
Inspect if this action was executed and valid.
This method may not be called before execute(). The default implementation returns always true, i.e. after execute(), it was executed. Override this method if it has more complex state semantics.
Reimplemented from RTT::base::ActionInterface.
Definition at line 231 of file CallFunction.hpp.