Public Member Functions | Private Member Functions | Private Attributes | List of all members
RTT::scripting::CallFunction Class Reference

#include <CallFunction.hpp>

Inheritance diagram for RTT::scripting::CallFunction:
Inheritance graph
[legend]

Public Member Functions

 CallFunction (base::ActionInterface *init_com, boost::shared_ptr< ProgramInterface > foo, ExecutionEngine *p, ExecutionEngine *caller)
 
base::ActionInterfaceclone () const
 
base::ActionInterfacecopy (std::map< const base::DataSourceBase *, base::DataSourceBase * > &alreadyCloned) const
 
virtual void dispose ()
 
virtual bool execute ()
 
virtual void executeAndDispose ()
 
virtual void readArguments ()
 
virtual void reset ()
 
virtual bool valid () const
 
 ~CallFunction ()
 
- Public Member Functions inherited from RTT::base::ActionInterface
virtual ActionInterfacecopy (std::map< const DataSourceBase *, DataSourceBase * > &alreadyCloned) const
 
virtual ~ActionInterface ()
 
- Public Member Functions inherited from RTT::base::DisposableInterface
virtual ~DisposableInterface ()
 

Private Member Functions

bool checkIfDone ()
 
bool checkIfDoneOrYielded ()
 

Private Attributes

boost::shared_ptr< ProgramInterface_foo
 
bool maccept
 
ExecutionEnginemcaller
 
base::ActionInterfaceminit
 
ExecutionEnginemrunner
 

Additional Inherited Members

- Public Types inherited from RTT::base::ActionInterface
typedef boost::shared_ptr< ActionInterfaceshared_ptr
 
- Public Types inherited from RTT::base::DisposableInterface
typedef boost::shared_ptr< DisposableInterfaceshared_ptr
 

Detailed Description

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.

Constructor & Destructor Documentation

RTT::scripting::CallFunction::CallFunction ( base::ActionInterface init_com,
boost::shared_ptr< ProgramInterface foo,
ExecutionEngine p,
ExecutionEngine caller 
)
inline

Create a Command to send a function to a ExecutionEngine.

Parameters
init_comThe command to execute before sending the function into the processor, in order to initialise it.
fooThe function to run in the processor.
pThe target processor which will run the function.

Definition at line 102 of file CallFunction.hpp.

RTT::scripting::CallFunction::~CallFunction ( )
inline

Definition at line 112 of file CallFunction.hpp.

Member Function Documentation

bool RTT::scripting::CallFunction::checkIfDone ( )
inlineprivate

Check if the function either finished successfully or encountered an error. Use this as a predicate to wait for full completion.

Exceptions
falseif the function encountered an error

Definition at line 84 of file CallFunction.hpp.

bool RTT::scripting::CallFunction::checkIfDoneOrYielded ( )
inlineprivate

Check if the function either finished successfully or encountered an error or yielded. Use this as a predicate to wait for partial completion.

Definition at line 75 of file CallFunction.hpp.

base::ActionInterface* RTT::scripting::CallFunction::clone ( ) const
inlinevirtual

The Clone Software Pattern.

Implements RTT::base::ActionInterface.

Definition at line 240 of file CallFunction.hpp.

base::ActionInterface* RTT::scripting::CallFunction::copy ( std::map< const base::DataSourceBase *, base::DataSourceBase * > &  alreadyCloned) const
inline

Definition at line 245 of file CallFunction.hpp.

virtual void RTT::scripting::CallFunction::dispose ( )
inlinevirtual

Just free this object without executing it.

Implements RTT::base::DisposableInterface.

Definition at line 225 of file CallFunction.hpp.

virtual bool RTT::scripting::CallFunction::execute ( )
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 (

See also
ExecutionEngine::process()), which calls into executeAndDispose() for actual execution in its callback step. If ProgramInterface::execute() would return true and the program did not yet finish (e.g. as a result of a yield command), it will be enqueued in the function queue for synchronous execution with the next update step.

()

Implements RTT::base::ActionInterface.

Definition at line 131 of file CallFunction.hpp.

virtual void RTT::scripting::CallFunction::executeAndDispose ( )
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 (

See also
execute()).

()

Implements RTT::base::DisposableInterface.

Definition at line 214 of file CallFunction.hpp.

virtual void RTT::scripting::CallFunction::readArguments ( )
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.

virtual void RTT::scripting::CallFunction::reset ( )
inlinevirtual

Reset this action. Must be used after execute() failed.

Reimplemented from RTT::base::ActionInterface.

Definition at line 227 of file CallFunction.hpp.

virtual bool RTT::scripting::CallFunction::valid ( ) const
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.

Member Data Documentation

boost::shared_ptr<ProgramInterface> RTT::scripting::CallFunction::_foo
private

Definition at line 67 of file CallFunction.hpp.

bool RTT::scripting::CallFunction::maccept
private

Definition at line 68 of file CallFunction.hpp.

ExecutionEngine* RTT::scripting::CallFunction::mcaller
private

Definition at line 66 of file CallFunction.hpp.

base::ActionInterface* RTT::scripting::CallFunction::minit
private

Definition at line 64 of file CallFunction.hpp.

ExecutionEngine* RTT::scripting::CallFunction::mrunner
private

Definition at line 65 of file CallFunction.hpp.


The documentation for this class was generated from the following file:


rtt
Author(s): RTT Developers
autogenerated on Fri Oct 25 2019 03:59:47