Orocos Real-Time Toolkit
2.6.0
|
Implements call, send, collect, collectIfDone for all function arities. More...
#include <rtt/internal/LocalOperationCaller.hpp>
Public Types | |
typedef FunctionT | Signature |
typedef boost::function_traits < Signature >::result_type | result_type |
typedef boost::function_traits < Signature >::result_type | result_reference |
typedef boost::function_traits < Signature > | traits |
typedef boost::shared_ptr < LocalOperationCallerImpl > | shared_ptr |
Use this type for shared pointer storage of an OperationCallerInterface object. | |
Public Member Functions | |
virtual bool | ready () const |
Available such that implementations have a way to expose their ready-ness, ie being able to do the call. | |
virtual bool | isError () const |
void | executeAndDispose () |
Execute functionality and free this object. | |
void | dispose () |
As long as dispose (or executeAndDispose() ) is not called, this object will not be destroyed. | |
ExecutionEngine * | getMessageProcessor () const |
SendHandle< Signature > | do_send (shared_ptr cl) |
SendHandle< Signature > | send_impl () |
template<class T1 > | |
SendHandle< Signature > | send_impl (T1 a1) |
template<class T1 , class T2 > | |
SendHandle< Signature > | send_impl (T1 a1, T2 a2) |
template<class T1 , class T2 , class T3 > | |
SendHandle< Signature > | send_impl (T1 a1, T2 a2, T3 a3) |
template<class T1 , class T2 , class T3 , class T4 > | |
SendHandle< Signature > | send_impl (T1 a1, T2 a2, T3 a3, T4 a4) |
template<class T1 , class T2 , class T3 , class T4 , class T5 > | |
SendHandle< Signature > | send_impl (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) |
template<class T1 , class T2 , class T3 , class T4 , class T5 , class T6 > | |
SendHandle< Signature > | send_impl (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6) |
template<class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 > | |
SendHandle< Signature > | send_impl (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7) |
SendStatus | collectIfDone_impl () |
template<class T1 > | |
SendStatus | collectIfDone_impl (T1 &a1) |
template<class T1 , class T2 > | |
SendStatus | collectIfDone_impl (T1 &a1, T2 &a2) |
template<class T1 , class T2 , class T3 > | |
SendStatus | collectIfDone_impl (T1 &a1, T2 &a2, T3 &a3) |
template<class T1 , class T2 , class T3 , class T4 > | |
SendStatus | collectIfDone_impl (T1 &a1, T2 &a2, T3 &a3, T4 &a4) |
template<class T1 , class T2 , class T3 , class T4 , class T5 > | |
SendStatus | collectIfDone_impl (T1 &a1, T2 &a2, T3 &a3, T4 &a4, T5 &a5) |
template<class T1 , class T2 , class T3 , class T4 , class T5 , class T6 > | |
SendStatus | collectIfDone_impl (T1 &a1, T2 &a2, T3 &a3, T4 &a4, T5 &a5, T6 &a6) |
template<class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 > | |
SendStatus | collectIfDone_impl (T1 &a1, T2 &a2, T3 &a3, T4 &a4, T5 &a5, T6 &a6, T7 &a7) |
SendStatus | collect_impl () |
template<class T1 > | |
SendStatus | collect_impl (T1 &a1) |
template<class T1 , class T2 > | |
SendStatus | collect_impl (T1 &a1, T2 &a2) |
template<class T1 , class T2 , class T3 > | |
SendStatus | collect_impl (T1 &a1, T2 &a2, T3 &a3) |
result_type | call_impl () |
Invoke this operator if the method has no arguments. | |
template<class T1 > | |
result_type | call_impl (T1 a1) |
Invoke this operator if the method has one argument. | |
template<class T1 , class T2 > | |
result_type | call_impl (T1 a1, T2 a2) |
template<class T1 , class T2 , class T3 > | |
result_type | call_impl (T1 a1, T2 a2, T3 a3) |
template<class T1 , class T2 , class T3 , class T4 > | |
result_type | call_impl (T1 a1, T2 a2, T3 a3, T4 a4) |
template<class T1 , class T2 , class T3 , class T4 , class T5 > | |
result_type | call_impl (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) |
template<class T1 , class T2 , class T3 , class T4 , class T5 , class T6 > | |
result_type | call_impl (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6) |
template<class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 > | |
result_type | call_impl (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7) |
result_type | ret_impl () |
template<class T1 > | |
result_type | ret_impl (T1 a1) |
This function has the same signature of call() and returns the stored return value, and tries to return all arguments. | |
template<class T1 , class T2 > | |
result_type | ret_impl (T1 a1, T2 a2) |
template<class T1 , class T2 , class T3 > | |
result_type | ret_impl (T1 a1, T2 a2, T3 a3) |
template<class T1 , class T2 , class T3 , class T4 > | |
result_type | ret_impl (T1 a1, T2 a2, T3 a3, T4 a4) |
template<class T1 , class T2 , class T3 , class T4 , class T5 > | |
result_type | ret_impl (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) |
template<class T1 , class T2 , class T3 , class T4 , class T5 , class T6 > | |
result_type | ret_impl (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6) |
template<class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 > | |
result_type | ret_impl (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7) |
virtual shared_ptr | cloneRT () const =0 |
virtual OperationCallerBase < FunctionT > * | cloneI (ExecutionEngine *caller) const =0 |
Creates a new clone of this method using operator new(). | |
void | setOwner (ExecutionEngine *ee) |
Set the ExecutionEngine of the task which owns this method. | |
void | setExecutor (ExecutionEngine *ee) |
Set an executor which will execute this method when it is called or sent. | |
void | setCaller (ExecutionEngine *ee) |
Sets the caller's engine of this operation. | |
bool | setThread (ExecutionThread et, ExecutionEngine *executor) |
Sets the Thread execution policy of this object. | |
void | reportError () |
Executed when the operation execution resulted in a C++ exception. | |
bool | isSend () |
Helpful function to tell us if this operations is to be sent or not. | |
Protected Types | |
typedef BindStorage< FunctionT > | Store |
Protected Attributes | |
base::OperationCallerBase < FunctionT >::shared_ptr | self |
Used to refcount self as long as dispose() is not called. | |
ExecutionEngine * | myengine |
ExecutionEngine * | caller |
ExecutionEngine * | ownerEngine |
ExecutionThread | met |
Implements call, send, collect, collectIfDone for all function arities.
You can pass arguments by (const) value and by (const) reference. Passing pointers is 'accidentally' supported in-process, it will not work with out-of-process calls. The send takes all arguments (C++ doesn't know pure out args), the collect() only takes the return value and the 'reference' arguments (if any)
If this object is disposed, the collection of results is no longer possible and this will generate a SendFailure at caller side.
Definition at line 77 of file LocalOperationCaller.hpp.
virtual OperationCallerBase<FunctionT >* RTT::base::OperationCallerBase< FunctionT >::cloneI | ( | ExecutionEngine * | caller | ) | const [pure virtual, inherited] |
Creates a new clone of this method using operator new().
caller | The ExecutionEngine of the task that wishes to call this method. |
void RTT::internal::LocalOperationCallerImpl< FunctionT >::executeAndDispose | ( | ) | [inline, virtual] |
Execute functionality and free this object.
You may no longer use this object after calling this method.
Implements RTT::base::DisposableInterface.
Definition at line 99 of file LocalOperationCaller.hpp.
References RTT::internal::LocalOperationCallerImpl< FunctionT >::dispose(), RTT::ExecutionEngine::process(), and RTT::base::OperationCallerInterface::reportError().
void OperationCallerInterface::reportError | ( | ) | [inherited] |
Executed when the operation execution resulted in a C++ exception.
Must report the error to the ExecutionEngine of the owner of this operation.
Definition at line 47 of file OperationCallerInterface.cpp.
References RTT::ExecutionEngine::setExceptionTask().
Referenced by RTT::internal::FusedMCallDataSource< Signature >::evaluate(), and RTT::internal::LocalOperationCallerImpl< FunctionT >::executeAndDispose().
void OperationCallerInterface::setCaller | ( | ExecutionEngine * | ee | ) | [inherited] |
Sets the caller's engine of this operation.
This object will be used to test if asynchronous messaging is required.
ee | The ExecutionEngine of the component that is calling this operation. |
Definition at line 31 of file OperationCallerInterface.cpp.
void OperationCallerInterface::setExecutor | ( | ExecutionEngine * | ee | ) | [inherited] |
Set an executor which will execute this method when it is called or sent.
If ee is set to 0, the method will be executed in the client's thread or the GlobalExecutionEngine.
ee | The ExecutionEngine of the component that is executing this operation. |
Definition at line 24 of file OperationCallerInterface.cpp.
Referenced by RTT::base::OperationCallerInterface::setThread().
void OperationCallerInterface::setOwner | ( | ExecutionEngine * | ee | ) | [inherited] |
Set the ExecutionEngine of the task which owns this method.
ee | The ExecutionEngine of the component that owns this operation. |
Definition at line 20 of file OperationCallerInterface.cpp.
bool OperationCallerInterface::setThread | ( | ExecutionThread | et, |
ExecutionEngine * | executor | ||
) | [inherited] |
Sets the Thread execution policy of this object.
et | OwnThread or ClientThread. |
executor | The engine of the component owning this operation. In case it is not yet owned by a component, executor may be null. |
Definition at line 38 of file OperationCallerInterface.cpp.
References RTT::base::OperationCallerInterface::setExecutor().
Referenced by RTT::Service::setOperationThread().
base::OperationCallerBase<FunctionT>::shared_ptr RTT::internal::LocalOperationCallerImpl< FunctionT >::self [protected] |
Used to refcount self as long as dispose() is not called.
This refcount is real-time since both shared_ptr and object were allocated with the rt_allocator class.
Definition at line 591 of file LocalOperationCaller.hpp.