39 #ifndef ORO_TASK_OPERATION_CALLER_HPP 40 #define ORO_TASK_OPERATION_CALLER_HPP 43 #include <boost/function.hpp> 45 #ifdef ORO_TEST_OPERATION_CALLER 81 template<
class SignatureT>
85 boost::shared_ptr< base::OperationCallerBase<SignatureT> > >,
94 boost::shared_ptr< base::OperationCallerBase<Signature> > >
Base;
95 typedef typename boost::function_traits<Signature>::result_type
result_type;
96 typedef boost::function_traits<Signature>
traits;
104 : Base(), mname(), mcaller(0)
113 : Base(), mname(name), mcaller(caller)
125 mname(m.mname), mcaller(m.mcaller)
144 this->impl.reset( m.impl->cloneI(mcaller) );
161 mname(), mcaller(caller)
163 if ( !this->impl && implementation ) {
164 log(
Error) <<
"Tried to construct OperationCaller from incompatible local operation."<<
endlog();
167 this->impl.reset( this->impl->cloneI(mcaller) );
182 mname(), mcaller(caller)
201 mname(name), mcaller(caller)
205 if (service->hasMember(name))
220 if (this->impl && this->impl == implementation)
262 if (this->mname.empty()) {
263 log(
Error) <<
"Can't initialise unnamed OperationCaller from service '"<<service->getName() <<
"'."<<
endlog();
271 #ifdef ORO_TEST_OPERATION_CALLER 281 template<
class M,
class ObjectType>
327 return this->impl && this->impl->ready();
336 *
this = implementation;
338 this->mcaller = caller;
339 this->impl->setCaller(caller);
364 this->impl = new_impl;
368 this->mcaller = caller;
370 this->impl->setCaller(caller);
389 }
catch( std::exception& e ) {
390 log(
Error) <<
"Constructing RemoteOperationCaller for "<< mname <<
" was not possible."<<
endlog();
394 if (this->impl->ready()) {
395 log(
Debug) <<
"Constructed OperationCaller from remote implementation '"<< mname<<
"'."<<
endlog();
398 log(
Error) <<
"Tried to construct OperationCaller from incompatible operation '"<< mname<<
"'."<<
endlog();
401 log(
Error) <<
"Tried to construct remote OperationCaller but ORO_REMOTING was disabled."<<
endlog();
405 this->impl.reset( this->impl->cloneI(mcaller) );
411 #ifdef ORO_TEST_OPERATION_CALLER 420 template<
class F,
class O>
OperationCaller(std::string name, ExecutionEngine *caller=0)
std::string const & getName() const
OperationCaller & operator=(OperationInterfacePart *part)
OperationCaller & operator=(ServicePtr service)
OperationCaller & operator=(const OperationCaller &m)
const OperationCallerBasePtr getOperationCallerImpl() const
internal::InvokerSignature< boost::function_traits< Signature >::arity, Signature, boost::shared_ptr< base::OperationCallerBase< Signature > > > Base
void setCaller(ExecutionEngine *caller)
ExecutionEngine * mcaller
virtual std::string getName() const =0
boost::shared_ptr< base::OperationCallerBase< Signature > > OperationCallerBasePtr
boost::function_traits< Signature >::result_type result_type
OperationCaller & operator=(boost::shared_ptr< base::DisposableInterface > implementation)
OperationCaller(OperationInterfacePart *part, ExecutionEngine *caller=0)
boost::shared_ptr< Service > ServicePtr
bool setImplementationPart(OperationInterfacePart *orp, ExecutionEngine *caller=0)
void setOperationCallerImpl(OperationCallerBasePtr new_impl)
OperationCaller(const std::string &name, ServicePtr service, ExecutionEngine *caller=0)
bool setImplementation(boost::shared_ptr< base::DisposableInterface > implementation, ExecutionEngine *caller=0)
boost::function_traits< Signature > traits
virtual RTT_API boost::shared_ptr< base::DisposableInterface > getLocalOperation() const
OperationCaller(const OperationCaller &m)
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
static Logger::LogFunction endlog()
OperationCaller(boost::shared_ptr< base::DisposableInterface > implementation, ExecutionEngine *caller=0)
void setupOperationCaller(OperationInterfacePart *part)