Public Types | Public Member Functions | Protected Member Functions | Private Attributes
RTT::OperationCaller< SignatureT > Class Template Reference

#include <OperationCaller.hpp>

Inheritance diagram for RTT::OperationCaller< SignatureT >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef
internal::InvokerSignature
< boost::function_traits
< Signature >::arity,
Signature, boost::shared_ptr
< base::OperationCallerBase
< Signature > > > 
Base
typedef boost::shared_ptr
< base::OperationCallerBase
< Signature > > 
OperationCallerBasePtr
typedef boost::function_traits
< Signature >::result_type 
result_type
typedef SignatureT Signature
typedef boost::function_traits
< Signature
traits

Public Member Functions

void disconnect ()
std::string const & getName () const
const OperationCallerBasePtr getOperationCallerImpl () const
 OperationCaller ()
 OperationCaller (std::string name, ExecutionEngine *caller=0)
 OperationCaller (const OperationCaller &m)
 OperationCaller (boost::shared_ptr< base::DisposableInterface > implementation, ExecutionEngine *caller=0)
 OperationCaller (OperationInterfacePart *part, ExecutionEngine *caller=0)
 OperationCaller (const std::string &name, ServicePtr service, ExecutionEngine *caller=0)
OperationCalleroperator= (const OperationCaller &m)
OperationCalleroperator= (boost::shared_ptr< base::DisposableInterface > implementation)
OperationCalleroperator= (OperationInterfacePart *part)
OperationCalleroperator= (ServicePtr service)
bool ready () const
void setCaller (ExecutionEngine *caller)
bool setImplementation (boost::shared_ptr< base::DisposableInterface > implementation, ExecutionEngine *caller=0)
bool setImplementationPart (OperationInterfacePart *orp, ExecutionEngine *caller=0)
void setOperationCallerImpl (OperationCallerBasePtr new_impl) const
 ~OperationCaller ()

Protected Member Functions

void setupOperationCaller (OperationInterfacePart *part)

Private Attributes

ExecutionEnginemcaller
std::string mname

Detailed Description

template<class SignatureT>
class RTT::OperationCaller< SignatureT >

A OperationCaller serves as a placeholder (aka 'proxy') for a remote Operation. If you want to call an operation, you need this class to do it.

The OperationCaller has the exact same signature template argument as the Operation it wishes to call.

OwnThread operations need the caller's ExecutionEngine to be able to inform it of completion . In case the caller has no ExecutionEngine, the GlobalEngine is used instead, and the GlobalEngine will block until the call completes.

Definition at line 82 of file OperationCaller.hpp.


Member Typedef Documentation

template<class SignatureT>
typedef internal::InvokerSignature<boost::function_traits<Signature>::arity, Signature, boost::shared_ptr< base::OperationCallerBase<Signature> > > RTT::OperationCaller< SignatureT >::Base

Definition at line 94 of file OperationCaller.hpp.

template<class SignatureT>
typedef boost::shared_ptr< base::OperationCallerBase<Signature> > RTT::OperationCaller< SignatureT >::OperationCallerBasePtr

Definition at line 97 of file OperationCaller.hpp.

template<class SignatureT>
typedef boost::function_traits<Signature>::result_type RTT::OperationCaller< SignatureT >::result_type

Definition at line 95 of file OperationCaller.hpp.

template<class SignatureT>
typedef SignatureT RTT::OperationCaller< SignatureT >::Signature

Definition at line 91 of file OperationCaller.hpp.

template<class SignatureT>
typedef boost::function_traits<Signature> RTT::OperationCaller< SignatureT >::traits

Definition at line 96 of file OperationCaller.hpp.


Constructor & Destructor Documentation

template<class SignatureT>
RTT::OperationCaller< SignatureT >::OperationCaller ( ) [inline]

Create an empty OperationCaller object. Use assignment to initialise it.

Definition at line 103 of file OperationCaller.hpp.

template<class SignatureT>
RTT::OperationCaller< SignatureT >::OperationCaller ( std::string  name,
ExecutionEngine caller = 0 
) [inline]

Create an OperationCaller object with a name and optional caller.

Parameters:
nameThe name of the operation that will be called.
nameThe ExecutionEngine of the TaskContext calling the operation.

Definition at line 112 of file OperationCaller.hpp.

template<class SignatureT>
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.

Parameters:
mthe original

Definition at line 123 of file OperationCaller.hpp.

template<class SignatureT>
RTT::OperationCaller< SignatureT >::OperationCaller ( boost::shared_ptr< base::DisposableInterface implementation,
ExecutionEngine caller = 0 
) [inline]

Initialise a nameless OperationCaller object from a local Operation.

Parameters:
implementationThe 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.
callerThe ExecutionEngine which will be used to call us back in case of asynchronous communication. If zero, the global Engine is used.

Definition at line 159 of file OperationCaller.hpp.

template<class SignatureT>
RTT::OperationCaller< SignatureT >::OperationCaller ( OperationInterfacePart part,
ExecutionEngine caller = 0 
) [inline]

Initialise a nameless OperationCaller object from an operation factory.

Parameters:
partThe OperationInterfacePart which is used by the OperationCaller object to get the implementation.
callerThe ExecutionEngine which will be used to call us back in case of asynchronous communication. If zero, the global Engine is used.

Definition at line 180 of file OperationCaller.hpp.

template<class SignatureT>
RTT::OperationCaller< SignatureT >::OperationCaller ( const std::string &  name,
ServicePtr  service,
ExecutionEngine caller = 0 
) [inline]

Initialise a named OperationCaller object from a Service.

Parameters:
nameThe name of the operation to look for.
serviceThe Service where the operation will be looked up.
callerThe ExecutionEngine which will be used to call us back in case of asynchronous communication. If zero, the global Engine is used.

Definition at line 199 of file OperationCaller.hpp.

template<class SignatureT>
RTT::OperationCaller< SignatureT >::~OperationCaller ( ) [inline]

Clean up the OperationCaller object.

Definition at line 317 of file OperationCaller.hpp.


Member Function Documentation

template<class SignatureT>
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.

Postcondition:
this->ready() == false

Implements RTT::base::OperationCallerBaseInvoker.

Definition at line 373 of file OperationCaller.hpp.

template<class SignatureT>
std::string const& RTT::OperationCaller< SignatureT >::getName ( ) const [inline, virtual]

Get the name of this OperationCaller.

Implements RTT::base::OperationCallerBaseInvoker.

Definition at line 333 of file OperationCaller.hpp.

template<class SignatureT>
const OperationCallerBasePtr RTT::OperationCaller< SignatureT >::getOperationCallerImpl ( ) const [inline]

Returns the internal implementation of the OperationCaller object.

Definition at line 356 of file OperationCaller.hpp.

template<class SignatureT>
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.

Parameters:
mthe original
Returns:
*this

Definition at line 137 of file OperationCaller.hpp.

template<class SignatureT>
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.

Parameters:
implementationthe implementation.
Returns:
*this

Definition at line 218 of file OperationCaller.hpp.

template<class SignatureT>
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.

Parameters:
partThe part used by the OperationCaller to produce an implementation.
Returns:
*this

Definition at line 236 of file OperationCaller.hpp.

template<class SignatureT>
OperationCaller& RTT::OperationCaller< SignatureT >::operator= ( ServicePtr  service) [inline]

Named OperationCaller objects may be looked up in a Service.

Parameters:
serviceThe Service where the operation will be looked up.
Returns:
*this

Definition at line 256 of file OperationCaller.hpp.

template<class SignatureT>
bool RTT::OperationCaller< SignatureT >::ready ( ) const [inline, virtual]

Check if this OperationCaller is ready for execution.

Returns:
true if so.

Implements RTT::base::OperationCallerBaseInvoker.

Definition at line 326 of file OperationCaller.hpp.

template<class SignatureT>
void RTT::OperationCaller< SignatureT >::setCaller ( ExecutionEngine caller) [inline, virtual]

Sets the caller of this method after the implementation was set.

Parameters:
caller

Implements RTT::base::OperationCallerBaseInvoker.

Definition at line 367 of file OperationCaller.hpp.

template<class SignatureT>
bool RTT::OperationCaller< SignatureT >::setImplementation ( boost::shared_ptr< base::DisposableInterface impl,
ExecutionEngine caller = 0 
) [inline, virtual]

Sets a new implementation for this method.

Parameters:
implAn implementation object that can be upcast to the OperationCallerBase class type of this method.
callerThe engine of the calling TaskContext.
Returns:
true if the impl could be upcast to a matching OperationCallerBase type, false otherwise.

Implements RTT::base::OperationCallerBaseInvoker.

Definition at line 335 of file OperationCaller.hpp.

template<class SignatureT>
bool RTT::OperationCaller< SignatureT >::setImplementationPart ( OperationInterfacePart orp,
ExecutionEngine caller = 0 
) [inline, virtual]

Sets a new implementation for this method by using a service part.

Parameters:
orpA part obtained from a service's OperationInterface.
callerThe engine of the calling TaskContext.
Returns:
true if the part could produce the correct OperationCallerBase type, false otherwise.

Implements RTT::base::OperationCallerBaseInvoker.

Definition at line 344 of file OperationCaller.hpp.

template<class SignatureT>
void RTT::OperationCaller< SignatureT >::setOperationCallerImpl ( OperationCallerBasePtr  new_impl) const [inline]

Sets the internal implementation of the OperationCaller object.

Definition at line 363 of file OperationCaller.hpp.

template<class SignatureT>
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.

Parameters:
part

Definition at line 383 of file OperationCaller.hpp.


Member Data Documentation

template<class SignatureT>
ExecutionEngine* RTT::OperationCaller< SignatureT >::mcaller [private]

Definition at line 89 of file OperationCaller.hpp.

template<class SignatureT>
std::string RTT::OperationCaller< SignatureT >::mname [private]

Definition at line 88 of file OperationCaller.hpp.


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


rtt
Author(s): RTT Developers
autogenerated on Wed Aug 26 2015 16:16:23