Orocos Real-Time Toolkit
2.6.0
|
A template-less SendHandle manager. More...
#include <rtt/internal/SendHandleC.hpp>
Public Member Functions | |
SendHandleC () | |
The default constructor. | |
SendHandleC (base::DataSourceBase::shared_ptr operation, base::DataSourceBase::shared_ptr handle, OperationInterfacePart *ofp, const std::string &name) | |
The constructor from a SendHandle data source and an operation part. | |
SendHandleC (const SendHandleC &other) | |
A SendHandleC is copyable by value. | |
SendHandleC & | operator= (const SendHandleC &other) |
A SendHandleC is assignable. | |
SendHandleC & | arg (base::DataSourceBase::shared_ptr a) |
Add a datasource argument to the SendHandle. | |
template<class ArgT > | |
SendHandleC & | arg (ArgT &a) |
Add an argument by reference to the OperationCaller. | |
SendStatus | collect () |
Collect the contained method. | |
SendStatus | collectIfDone () |
Collect the contained method. | |
void | check () |
Checks if this handle is ready for collecting, will throw if not so. | |
bool | ready () const |
Returns true if this handle is ready for execution. | |
void | setAutoCollect (bool on_off) |
When set to 'on', the destruction of this SendHandleC will cause a call to collect() before all data in data sources is destroyed. | |
base::DataSourceBase::shared_ptr | getSendHandleDataSource () |
Get the contained data source for send handle. | |
OperationInterfacePart * | getOrp () |
Get the contained OperationInterfacePart for SendHandle. |
A template-less SendHandle manager.
It is created using a SendHandle data source, obtained from a OperationFactoryPart::produceSend(), the part itself and any arguments that must be provided to collect the results.
It is used by OperationCallerC to pass on responsibility to collect results to a separate object.
Definition at line 61 of file SendHandleC.hpp.
The default constructor.
Make a copy from another SendHandleC object in order to make it usable.
RTT::internal::SendHandleC::SendHandleC | ( | base::DataSourceBase::shared_ptr | operation, |
base::DataSourceBase::shared_ptr | handle, | ||
OperationInterfacePart * | ofp, | ||
const std::string & | name | ||
) |
The constructor from a SendHandle data source and an operation part.
The SendHandle is obtained after a send.
Add a datasource argument to the SendHandle.
a | A DataSource which contents are filled in in case of collect() or collectIfDone() |
SendHandleC& RTT::internal::SendHandleC::arg | ( | ArgT & | a | ) | [inline] |
Add an argument by reference to the OperationCaller.
a | A value of which the reference is used and re-read each time the method is called. Thus if the contents of the source of a changes, call() will use the new contents. |
Definition at line 115 of file SendHandleC.hpp.
void RTT::internal::SendHandleC::check | ( | ) |
Checks if this handle is ready for collecting, will throw if not so.
Otherwise, does nothing.
void RTT::internal::SendHandleC::setAutoCollect | ( | bool | on_off | ) |
When set to 'on', the destruction of this SendHandleC will cause a call to collect() before all data in data sources is destroyed.
This is required for in-process operation calls, since destruction of the data sources would lead to memory corruption of the operation's arguments. When set to 'off', no such collection is done, which is useful in remote/inter-process communication, in which the data lives in a copy in the other process anyway. Since RTT uses this same class for both situations, we need a flag to distinguish.
Defaults to 'on', which is the safe default if unspecified.