Orocos Real-Time Toolkit
2.5.0
|
A OperationCaller serves as a placeholder (aka 'proxy') for a remote Operation. More...
#include <rtt/OperationCaller.hpp>
Public Types | |
typedef SignatureT | Signature |
typedef internal::InvokerSignature < boost::function_traits < Signature >::arity, Signature, boost::shared_ptr < base::OperationCallerBase < Signature > > > | Base |
typedef boost::function_traits < Signature >::result_type | result_type |
typedef boost::function_traits < Signature > | traits |
typedef boost::shared_ptr < base::OperationCallerBase < Signature > > | OperationCallerBasePtr |
Public Member Functions | |
OperationCaller () | |
Create an empty OperationCaller object. | |
OperationCaller (std::string name, ExecutionEngine *caller=0) | |
Create an empty OperationCaller object. | |
OperationCaller (const OperationCaller &m) | |
OperationCaller objects may be copied. | |
OperationCaller & | operator= (const OperationCaller &m) |
OperationCaller objects may be assigned. | |
OperationCaller (boost::shared_ptr< base::DisposableInterface > implementation, ExecutionEngine *caller=0) | |
Initialise a nameless OperationCaller object from a local Operation. | |
OperationCaller (OperationInterfacePart *part, ExecutionEngine *caller=0) | |
Initialise a nameless OperationCaller object from an operation factory. | |
OperationCaller (const std::string &name, ServicePtr service, ExecutionEngine *caller=0) | |
Initialise a named OperationCaller object from a Service. | |
OperationCaller & | operator= (boost::shared_ptr< base::DisposableInterface > implementation) |
OperationCaller objects may be assigned to an implementation. | |
OperationCaller & | operator= (OperationInterfacePart *part) |
OperationCaller objects may be assigned to a part responsible for production of an implementation. | |
OperationCaller & | operator= (ServicePtr service) |
Named OperationCaller objects may be looked up in a Service. | |
~OperationCaller () | |
Clean up the OperationCaller object. | |
bool | ready () const |
Check if this OperationCaller is ready for execution. | |
std::string const & | getName () const |
Get the name of this method. | |
bool | setImplementation (boost::shared_ptr< base::DisposableInterface > implementation, ExecutionEngine *caller=0) |
Sets a new implementation for this method. | |
bool | setImplementationPart (OperationInterfacePart *orp, ExecutionEngine *caller=0) |
Sets a new implementation for this method by using a service part. | |
const OperationCallerBasePtr | getOperationCallerImpl () const |
Returns the internal implementation of the OperationCaller object. | |
void | setOperationCallerImpl (OperationCallerBasePtr new_impl) const |
Sets the internal implementation of the OperationCaller object. | |
void | setCaller (ExecutionEngine *caller) |
Sets the caller of this method after the implementation was set. | |
void | disconnect () |
Disconnects this caller from the operation it was connected to. | |
Protected Member Functions | |
void | setupOperationCaller (OperationInterfacePart *part) |
If no local implementation of an operation could be found, this method tries it using the operationrepository factories. |
A OperationCaller serves as a placeholder (aka 'proxy') for a remote Operation.
If you want to call an operation, you need a method to do it.
The OperationCaller has the exact same signature template argument as the operation it wishes to call.
Asynchronous methods need a caller's ExecutionEngine to be able to process the completion message. In case the caller has no ExecutionEngine, the GlobalExecutionEngine is used instead.
Definition at line 82 of file OperationCaller.hpp.
RTT::OperationCaller< SignatureT >::OperationCaller | ( | ) | [inline] |
Create an empty OperationCaller object.
Use assignment to initialise it.
Definition at line 103 of file OperationCaller.hpp.
RTT::OperationCaller< SignatureT >::OperationCaller | ( | std::string | name, |
ExecutionEngine * | caller = 0 |
||
) | [inline] |
Create an empty OperationCaller object.
Use assignment to initialise it.
Definition at line 111 of file OperationCaller.hpp.
RTT::OperationCaller< SignatureT >::OperationCaller | ( | const OperationCaller< SignatureT > & | m | ) | [inline] |
OperationCaller objects may be copied.
A deep copy is made of the implementation object such that using this object does not interfere when using the original, m.
m | the original |
Definition at line 122 of file OperationCaller.hpp.
RTT::OperationCaller< SignatureT >::OperationCaller | ( | boost::shared_ptr< base::DisposableInterface > | implementation, |
ExecutionEngine * | caller = 0 |
||
) | [inline] |
Initialise a nameless OperationCaller object from a local Operation.
implementation | The implementation of the operation which is to be used by the OperationCaller object. This object will be cloned such that the method uses its own implementation. |
caller | The ExecutionEngine which will be used to call us back in case of asynchronous communication. If zero, the global Engine is used. |
Definition at line 158 of file OperationCaller.hpp.
RTT::OperationCaller< SignatureT >::OperationCaller | ( | OperationInterfacePart * | part, |
ExecutionEngine * | caller = 0 |
||
) | [inline] |
Initialise a nameless OperationCaller object from an operation factory.
part | The OperationInterfacePart which is used by the OperationCaller object to get the implementation. |
caller | The ExecutionEngine which will be used to call us back in case of asynchronous communication. If zero, the global Engine is used. |
Definition at line 179 of file OperationCaller.hpp.
RTT::OperationCaller< SignatureT >::OperationCaller | ( | const std::string & | name, |
ServicePtr | service, | ||
ExecutionEngine * | caller = 0 |
||
) | [inline] |
Initialise a named OperationCaller object from a Service.
name | The name of the operation to look for. |
service | The Service where the operation will be looked up. |
caller | The ExecutionEngine which will be used to call us back in case of asynchronous communication. If zero, the global Engine is used. |
Definition at line 198 of file OperationCaller.hpp.
void RTT::OperationCaller< SignatureT >::disconnect | ( | ) | [inline, virtual] |
Disconnects this caller from the operation it was connected to.
If this OperationCaller had a name, the name is still kept.
Implements RTT::base::OperationCallerBaseInvoker.
Definition at line 371 of file OperationCaller.hpp.
OperationCaller& RTT::OperationCaller< SignatureT >::operator= | ( | const OperationCaller< SignatureT > & | m | ) | [inline] |
OperationCaller objects may be assigned.
A deep copy is made of the implementation object such that using this object does not interfere when using the original, m.
m | the original |
Definition at line 136 of file OperationCaller.hpp.
OperationCaller& RTT::OperationCaller< SignatureT >::operator= | ( | boost::shared_ptr< base::DisposableInterface > | implementation | ) | [inline] |
OperationCaller objects may be assigned to an implementation.
This variant is used when a local implementation is available.
implementation | the implementation. |
Definition at line 217 of file OperationCaller.hpp.
OperationCaller& RTT::OperationCaller< SignatureT >::operator= | ( | OperationInterfacePart * | part | ) | [inline] |
OperationCaller objects may be assigned to a part responsible for production of an implementation.
This variant is used when a only a remote implementation is available.
part | The part used by the OperationCaller to produce an implementation. |
Definition at line 235 of file OperationCaller.hpp.
OperationCaller& RTT::OperationCaller< SignatureT >::operator= | ( | ServicePtr | service | ) | [inline] |
Named OperationCaller objects may be looked up in a Service.
service | The Service where the operation will be looked up. |
Definition at line 255 of file OperationCaller.hpp.
bool RTT::OperationCaller< SignatureT >::ready | ( | ) | const [inline, virtual] |
Check if this OperationCaller is ready for execution.
Implements RTT::base::OperationCallerBaseInvoker.
Definition at line 323 of file OperationCaller.hpp.
Referenced by RTT::OperationCaller< int(const std::string &)>::setImplementation(), and RTT::OperationCaller< int(const std::string &)>::setImplementationPart().
void RTT::OperationCaller< SignatureT >::setCaller | ( | ExecutionEngine * | caller | ) | [inline, virtual] |
Sets the caller of this method after the implementation was set.
caller |
Implements RTT::base::OperationCallerBaseInvoker.
Definition at line 365 of file OperationCaller.hpp.
bool RTT::OperationCaller< SignatureT >::setImplementation | ( | boost::shared_ptr< base::DisposableInterface > | impl, |
ExecutionEngine * | caller = 0 |
||
) | [inline, virtual] |
Sets a new implementation for this method.
impl | An implementation object that can be upcast to the OperationCallerBase class type of this method. |
caller | The engine of the calling TaskContext. |
Implements RTT::base::OperationCallerBaseInvoker.
Definition at line 333 of file OperationCaller.hpp.
bool RTT::OperationCaller< SignatureT >::setImplementationPart | ( | OperationInterfacePart * | orp, |
ExecutionEngine * | caller = 0 |
||
) | [inline, virtual] |
Sets a new implementation for this method by using a service part.
orp | A part obtained from a service's OperationInterface. |
caller | The engine of the calling TaskContext. |
Implements RTT::base::OperationCallerBaseInvoker.
Definition at line 342 of file OperationCaller.hpp.
void RTT::OperationCaller< SignatureT >::setupOperationCaller | ( | OperationInterfacePart * | part | ) | [inline, protected] |
If no local implementation of an operation could be found, this method tries it using the operationrepository factories.
part |
Definition at line 381 of file OperationCaller.hpp.
Referenced by RTT::OperationCaller< int(const std::string &)>::OperationCaller().