Orocos Real-Time Toolkit
2.9.0
|
The operation ties a C or C++ function into a component interface. More...
#include <rtt/base/OperationBase.hpp>
Public Member Functions | |
Operation (const std::string &name) | |
Create an operation object with a name. More... | |
Operation (const std::string &name, boost::function< Signature > func, ExecutionThread et=ClientThread, ExecutionEngine *ownerEngine=NULL) | |
Create an operation object with a name and function to execute. More... | |
template<class Function , class Object > | |
Operation (const std::string &name, Function func, Object o, ExecutionThread et=ClientThread, ExecutionEngine *ownerEngine=NULL) | |
Create an operation object with a name and class member function to execute. More... | |
~Operation () | |
Operation< Signature > & | doc (const std::string &description) |
Document this operation. More... | |
Operation< Signature > & | arg (const std::string &name, const std::string &description) |
Document an argument of this operation. More... | |
Operation & | calls (boost::function< Signature > func, ExecutionThread et=ClientThread, ExecutionEngine *ownerEngine=NULL) |
Indicate that this operation calls a given function. More... | |
template<class Function , class Object > | |
Operation & | calls (Function func, Object o, ExecutionThread et=ClientThread, ExecutionEngine *ownerEngine=NULL) |
Indicate that this operation calls a given class member function. More... | |
virtual base::DisposableInterface::shared_ptr | getImplementation () |
Returns the implementation object of this operation. More... | |
virtual const base::DisposableInterface::shared_ptr | getImplementation () const |
virtual base::OperationCallerBase< Signature >::shared_ptr | getOperationCaller () |
virtual const base::OperationCallerBase< Signature >::shared_ptr | getOperationCaller () const |
const std::string & | getName () |
Returns the name of this operation. More... | |
const std::vector< std::string > & | getDescriptions () |
Returns all the documented descriptions of this operation, as a single list, starting with the operation's description, followed by the name, description pairs of each argument. More... | |
bool | ready () const |
An operation is ready if it has an implementation and is present in a TaskContext. More... | |
void | setOwner (ExecutionEngine *ee) |
Updates the owning ExecutionEngine that might execute this operation. More... | |
ExecutionEngine * | getOwner () const |
Protected Member Functions | |
RTT_API void | mdoc (const std::string &description) |
RTT_API void | marg (const std::string &name, const std::string &description) |
Protected Attributes | |
std::string | mname |
std::vector< std::string > | descriptions |
ExecutionEngine * | mowner |
The operation ties a C or C++ function into a component interface.
An operation consists of a name and a Signature.
For example, if you want his operation to call a function: bool foo(int a, double b) { return a < b; } Then the function Signature looks like: 'bool(int,double)' which is the signature type of 'bool foo(int a, double b)'. So a function signature is written as the function declaration, but without the function and argument names.
Signature | A template parameter that contains the function signature type of the function this operation object will call. |
Definition at line 52 of file OperationBase.hpp.
|
inline |
Create an operation object with a name.
The resulting object will not call any function but can be used to attach Signal handlers to (using signals() ) or set the function to call later on with calls().
name | The name of this instance. |
Definition at line 83 of file Operation.hpp.
|
inline |
Create an operation object with a name and function to execute.
name | The name of this instance. |
func | The function to execute, for example &foo. |
et | The thread that should execute the function when the operation is invoked. |
ownerEngine | the execution engine of the owner of this operation if any. Will be automatically set when you use Service::addOperation(). |
Definition at line 98 of file Operation.hpp.
|
inline |
Create an operation object with a name and class member function to execute.
name | The name of this instance. |
func | The function to execute, for example &Bar::foo |
o | The object that has this function, for example &bar |
et | The thread that should execute the function when the operation is invoked. |
ownerEngine | the execution engine of the owner of this operation if any. Will be automatically set when you use Service::addOperation(). |
Definition at line 113 of file Operation.hpp.
|
inline |
Definition at line 119 of file Operation.hpp.
|
inline |
Document an argument of this operation.
Each time arg() is called, it documents the next argument.
name | A single word (identifier) denoting the name of this argument |
description | A descriptive line of text for this argument |
Definition at line 137 of file Operation.hpp.
Referenced by RTT_corba_COperationInterface_i::RTT_corba_COperationInterface_i().
|
inline |
Indicate that this operation calls a given function.
This will replace any previously registered function present in this operation.
func | The function to call when the operation is invoked |
et | The thread that should execute the function when the operation is invoked. |
ownerEngine | the execution engine of the owner of this operation if any. |
Definition at line 147 of file Operation.hpp.
Referenced by RTT::Operation< bool(std::string) >::Operation().
|
inline |
Indicate that this operation calls a given class member function.
This will replace any previously registered function present in this operation.
func | The function to call when the operation is invoked, for example &Bar::foo |
o | The object that has this function, for example &bar |
et | The thread that should execute the function when the operation is invoked. |
ownerEngine | the execution engine of the owner of this operation if any. |
Definition at line 168 of file Operation.hpp.
|
inline |
Document this operation.
description | A descriptive line of text. |
Definition at line 128 of file Operation.hpp.
Referenced by RTT_corba_COperationInterface_i::RTT_corba_COperationInterface_i().
|
inlineinherited |
Returns all the documented descriptions of this operation, as a single list, starting with the operation's description, followed by the name, description pairs of each argument.
In case no argument was documented, only the description of the operation is returned.
Definition at line 93 of file OperationBase.hpp.
References RTT::base::OperationBase::descriptions, and RTT::base::OperationBase::getImplementation().
Referenced by RTT::internal::OperationInterfacePartHelper::description(), RTT::internal::OperationInterfacePartFusedDS< Signature, ObjT >::description(), RTT::internal::OperationInterfacePartHelper::getArgumentList(), and RTT::internal::OperationInterfacePartFusedDS< Signature, ObjT >::getArgumentList().
|
inlinevirtual |
Returns the implementation object of this operation.
Implements RTT::base::OperationBase.
Definition at line 226 of file Operation.hpp.
Referenced by RTT::internal::OperationInterfacePartFused< bool(std::string)>::getLocalOperation(), RTT::internal::SynchronousOperationInterfacePartFused< Signature >::getLocalOperation(), and RTT::internal::OperationInterfacePartFusedDS< Signature, ObjT >::getLocalOperation().
|
inlinevirtual |
Implements RTT::base::OperationBase.
Definition at line 227 of file Operation.hpp.
|
inlineinherited |
Returns the name of this operation.
Definition at line 84 of file OperationBase.hpp.
References RTT::base::OperationBase::mname.
Referenced by RTT::Service::addLocalOperation(), RTT::Service::addOperation(), RTT::Service::addOperationDS(), RTT::Service::addSynchronousOperation(), RTT::internal::OperationInterfacePartFused< bool(std::string)>::getName(), RTT::internal::SynchronousOperationInterfacePartFused< Signature >::getName(), and RTT::internal::OperationInterfacePartFusedDS< Signature, ObjT >::getName().
|
inlinevirtual |
Definition at line 229 of file Operation.hpp.
Referenced by RTT::internal::OperationInterfacePartFused< bool(std::string)>::produce(), RTT::internal::SynchronousOperationInterfacePartFused< Signature >::produce(), RTT::internal::OperationInterfacePartFusedDS< Signature, ObjT >::produce(), RTT::internal::OperationInterfacePartFusedDS< Signature, ObjT >::produceCollect(), RTT::internal::OperationInterfacePartFused< bool(std::string)>::produceSend(), and RTT::internal::OperationInterfacePartFusedDS< Signature, ObjT >::produceSend().
|
inlinevirtual |
Definition at line 230 of file Operation.hpp.
|
inlineinherited |
Definition at line 122 of file OperationBase.hpp.
References RTT::base::OperationBase::mowner.
|
protectedinherited |
Definition at line 68 of file OperationBase.cpp.
References RTT::base::OperationBase::descriptions.
Referenced by RTT::Operation< bool(std::string) >::arg().
|
protectedinherited |
Definition at line 64 of file OperationBase.cpp.
References RTT::base::OperationBase::descriptions.
Referenced by RTT::Operation< bool(std::string) >::doc().
|
inlineinherited |
An operation is ready if it has an implementation and is present in a TaskContext.
Definition at line 108 of file OperationBase.hpp.
References RTT::base::OperationBase::getImplementation().
|
inlineinherited |
Updates the owning ExecutionEngine that might execute this operation.
ee |
Definition at line 116 of file OperationBase.hpp.
References RTT::base::OperationBase::ownerUpdated().
Referenced by RTT::Service::addLocalOperation().
|
protectedinherited |
Definition at line 71 of file OperationBase.hpp.
Referenced by RTT::base::OperationBase::getDescriptions(), RTT::base::OperationBase::marg(), RTT::base::OperationBase::mdoc(), and RTT::base::OperationBase::OperationBase().
|
protectedinherited |
Definition at line 70 of file OperationBase.hpp.
Referenced by RTT::base::OperationBase::getName().
|
protectedinherited |
Definition at line 72 of file OperationBase.hpp.
Referenced by RTT::Operation< bool(std::string) >::calls(), RTT::Operation< bool(std::string) >::getOperationCaller(), and RTT::base::OperationBase::getOwner().