Orocos Real-Time Toolkit
2.5.0
|
A Factory which delivers operations which execute a FunctionGraph in an engine. More...
#include <rtt/scripting/FunctionFactory.hpp>
Public Member Functions | |
FunctionFactory (ProgramInterfacePtr func, ExecutionEngine *procs) | |
std::string | resultType () const |
Return the result (return) type of this operation. | |
unsigned int | arity () const |
Returns the arity (number of arguments) of this operation. | |
unsigned int | collectArity () const |
Returns the number of collectable arguments of this operation's function. | |
const types::TypeInfo * | getArgumentType (unsigned int arg) const |
Returns the type information of the n'th argument, with argument zero being the return value. | |
const types::TypeInfo * | getCollectType (unsigned int arg) const |
Returns the type information of the n'th collectable argument. | |
std::string | getName () const |
Returns the name of this operation. | |
std::string | description () const |
Returns the description of this operation. | |
std::vector< ArgumentDescription > | getArgumentList () const |
Get a description of the desired arguments in the ArgumentDescription format. | |
base::DataSourceBase::shared_ptr | produce (const std::vector< base::DataSourceBase::shared_ptr > &args, ExecutionEngine *caller) const |
Create a DataSource for a given callable operation. | |
base::DataSourceBase::shared_ptr | produceHandle () const |
Create an empty SendHandle object for this operation. | |
base::DataSourceBase::shared_ptr | produceSend (const std::vector< base::DataSourceBase::shared_ptr > &args, ExecutionEngine *caller) const |
Create a DataSource for a given send operation. | |
base::DataSourceBase::shared_ptr | produceCollect (const std::vector< base::DataSourceBase::shared_ptr > &args, internal::DataSource< bool >::shared_ptr blocking) const |
Create a DataSource for collecting the results of a Send. | |
virtual RTT_API boost::shared_ptr < base::DisposableInterface > | getLocalOperation () const |
Returns any local operation associated with this operation. |
A Factory which delivers operations which execute a FunctionGraph in an engine.
Definition at line 57 of file FunctionFactory.hpp.
unsigned int RTT::FunctionFactory::arity | ( | ) | const [virtual] |
Returns the arity (number of arguments) of this operation.
Implements RTT::OperationInterfacePart.
Definition at line 90 of file FunctionFactory.cpp.
unsigned int RTT::FunctionFactory::collectArity | ( | ) | const [virtual] |
Returns the number of collectable arguments of this operation's function.
These consist of the return value and the reference arguments.
Implements RTT::OperationInterfacePart.
Definition at line 95 of file FunctionFactory.cpp.
Referenced by getCollectType().
std::string RTT::FunctionFactory::description | ( | ) | const [virtual] |
Returns the description of this operation.
Implements RTT::OperationInterfacePart.
Definition at line 76 of file FunctionFactory.cpp.
const types::TypeInfo * RTT::FunctionFactory::getArgumentType | ( | unsigned int | arg | ) | const [virtual] |
Returns the type information of the n'th argument, with argument zero being the return value.
arg | 0: get return value type, 1..arity(): get n'th argument type. |
Implements RTT::OperationInterfacePart.
Definition at line 100 of file FunctionFactory.cpp.
const types::TypeInfo * RTT::FunctionFactory::getCollectType | ( | unsigned int | arg | ) | const [virtual] |
Returns the type information of the n'th collectable argument.
The numbering of arg starts from 1.
arg | 1..collectArity(): get n'th argument type. |
Implements RTT::OperationInterfacePart.
Definition at line 114 of file FunctionFactory.cpp.
References collectArity().
boost::shared_ptr< base::DisposableInterface > OperationInterfacePart::getLocalOperation | ( | ) | const [virtual, inherited] |
Returns any local operation associated with this operation.
Reimplemented in RTT::internal::OperationInterfacePartFusedDS< Signature, ObjT >, RTT::internal::SynchronousOperationInterfacePartFused< Signature >, and RTT::internal::OperationInterfacePartFused< Signature >.
Definition at line 53 of file OperationInterface.cpp.
Referenced by RTT::OperationCaller< int(const std::string &)>::OperationCaller(), RTT::OperationCaller< int(const std::string &)>::operator=(), and RTT::Service::setOperationThread().
std::string RTT::FunctionFactory::getName | ( | ) | const [virtual] |
Returns the name of this operation.
Implements RTT::OperationInterfacePart.
Definition at line 72 of file FunctionFactory.cpp.
DataSourceBase::shared_ptr RTT::FunctionFactory::produce | ( | const std::vector< base::DataSourceBase::shared_ptr > & | args, |
ExecutionEngine * | caller | ||
) | const [virtual] |
Create a DataSource for a given callable operation.
args | The arguments for the target object's function. The number of arguments must be identical to this->arity() |
caller | The Engine that will receive notifications when the method has been executed, in case it runs in the owner's thread. Normally, this is the engine of the caller's TaskContext. |
Implements RTT::OperationInterfacePart.
Definition at line 120 of file FunctionFactory.cpp.
References RTT::scripting::CommandComposite::add(), and RTT::base::AttributeBase::getDataSource().
base::DataSourceBase::shared_ptr RTT::FunctionFactory::produceCollect | ( | const std::vector< base::DataSourceBase::shared_ptr > & | args, |
internal::DataSource< bool >::shared_ptr | blocking | ||
) | const [virtual] |
Create a DataSource for collecting the results of a Send.
args | A vector of data sources of which the first element contains a properly initialised sendhandle and the remainder of the elements contains datasources for collecting the return value and reference arguments. The total number of items in args must be collectArity() + 1 |
blocking | Set to true to do a blocking collect, false for a polling version. |
wrong_number_of_args_exception | |
wrong_types_of_args_exception | |
name_not_found_exception | |
no_asynchronous_operation_exception |
Implements RTT::OperationInterfacePart.
Definition at line 189 of file FunctionFactory.cpp.
base::DataSourceBase::shared_ptr RTT::FunctionFactory::produceHandle | ( | ) | const [virtual] |
Create an empty SendHandle object for this operation.
wrong_number_of_args_exception | |
wrong_types_of_args_exception | |
name_not_found_exception | |
no_asynchronous_operation_exception |
Implements RTT::OperationInterfacePart.
Definition at line 180 of file FunctionFactory.cpp.
base::DataSourceBase::shared_ptr RTT::FunctionFactory::produceSend | ( | const std::vector< base::DataSourceBase::shared_ptr > & | args, |
ExecutionEngine * | caller | ||
) | const [virtual] |
Create a DataSource for a given send operation.
args | The arguments for the target object's function. The number of arguments must be identical to this->arity() |
caller | The Engine that will receive notifications when the method has been executed. Normally, this is the engine of the caller's TaskContext. |
wrong_number_of_args_exception | |
wrong_types_of_args_exception | |
name_not_found_exception | |
no_asynchronous_operation_exception |
Implements RTT::OperationInterfacePart.
Definition at line 184 of file FunctionFactory.cpp.