Orocos Real-Time Toolkit
2.8.3
|
A template-less SendHandle manager. More...
#include <rtt/internal/SendHandleC.hpp>
Classes | |
class | D |
class | E |
Public Member Functions | |
SendHandleC () | |
The default constructor. More... | |
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. More... | |
SendHandleC (const SendHandleC &other) | |
A SendHandleC is copyable by value. More... | |
SendHandleC & | operator= (const SendHandleC &other) |
A SendHandleC is assignable. More... | |
~SendHandleC () | |
SendHandleC & | arg (base::DataSourceBase::shared_ptr a) |
Add a datasource argument to the SendHandle. More... | |
template<class ArgT > | |
SendHandleC & | arg (ArgT &a) |
Add an argument by reference to the OperationCaller. More... | |
SendStatus | collect () |
Collect the contained method. More... | |
SendStatus | collectIfDone () |
Collect the contained method. More... | |
void | check () |
Checks if this handle is ready for collecting, will throw if not so. More... | |
bool | ready () const |
Returns true if this handle is ready for execution. More... | |
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. More... | |
base::DataSourceBase::shared_ptr | getSendHandleDataSource () |
Get the contained data source for send handle. More... | |
OperationInterfacePart * | getOrp () |
Get the contained OperationInterfacePart for SendHandle. More... | |
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.
RTT::internal::SendHandleC::SendHandleC | ( | ) |
The default constructor.
Make a copy from another SendHandleC object in order to make it usable.
Definition at line 162 of file SendHandleC.cpp.
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.
Definition at line 167 of file SendHandleC.cpp.
References RTT::internal::SendHandleC::E::b, RTT::internal::SendHandleC::D::blocking, RTT::internal::SendHandleC::E::mopkeeper, RTT::internal::SendHandleC::E::orp, RTT::internal::SendHandleC::E::s, and RTT::internal::SendHandleC::D::s.
RTT::internal::SendHandleC::SendHandleC | ( | const SendHandleC & | other | ) |
A SendHandleC is copyable by value.
Definition at line 180 of file SendHandleC.cpp.
RTT::internal::SendHandleC::~SendHandleC | ( | ) |
Definition at line 199 of file SendHandleC.cpp.
SendHandleC & RTT::internal::SendHandleC::arg | ( | base::DataSourceBase::shared_ptr | a | ) |
Add a datasource argument to the SendHandle.
a | A DataSource which contents are filled in in case of collect() or collectIfDone() |
Definition at line 205 of file SendHandleC.cpp.
References RTT::internal::SendHandleC::E::b, RTT::internal::SendHandleC::D::blocking, RTT::Logger::endl(), RTT::Logger::log(), RTT::internal::SendHandleC::D::mofp, RTT::internal::SendHandleC::E::mopkeeper, RTT::internal::SendHandleC::D::newarg(), RTT::internal::SendHandleC::E::orp, RTT::internal::SendHandleC::E::s, RTT::internal::SendHandleC::D::s, and RTT::Logger::Warning.
Referenced by RTT_corba_CSendHandle_i::RTT_corba_CSendHandle_i().
|
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.
Definition at line 271 of file SendHandleC.cpp.
References RTT::internal::SendHandleC::D::args, RTT::internal::SendHandleC::D::blocking, RTT::internal::SendHandleC::D::mofp, and RTT::OperationInterfacePart::produceCollect().
SendStatus RTT::internal::SendHandleC::collect | ( | ) |
Collect the contained method.
Definition at line 223 of file SendHandleC.cpp.
References RTT::internal::SendHandleC::D::args, RTT::internal::SendHandleC::E::b, RTT::OperationInterfacePart::collectArity(), RTT::Logger::endl(), RTT::Logger::Error, RTT::internal::DataSource< T >::evaluate(), RTT::Logger::log(), RTT::internal::SendHandleC::D::mname, RTT::internal::SendHandleC::D::mofp, RTT::Logger::nl(), RTT::internal::SendHandleC::E::s, RTT::SendFailure, RTT::internal::AssignableDataSource< T >::set(), and RTT::internal::DataSource< T >::value().
Referenced by RTT_corba_CSendHandle_i::collect(), and RTT::internal::RemoteOperationCallerImpl< OperationCallerT >::collect_impl().
SendStatus RTT::internal::SendHandleC::collectIfDone | ( | ) |
Collect the contained method.
Definition at line 241 of file SendHandleC.cpp.
References RTT::internal::SendHandleC::D::args, RTT::internal::SendHandleC::E::b, RTT::OperationInterfacePart::collectArity(), RTT::Logger::endl(), RTT::Logger::Error, RTT::internal::DataSource< T >::evaluate(), RTT::Logger::log(), RTT::internal::SendHandleC::D::mname, RTT::internal::SendHandleC::D::mofp, RTT::Logger::nl(), RTT::internal::SendHandleC::E::s, RTT::SendFailure, RTT::internal::AssignableDataSource< T >::set(), and RTT::internal::DataSource< T >::value().
Referenced by RTT_corba_CSendHandle_i::checkStatus(), RTT_corba_CSendHandle_i::collectIfDone(), RTT::internal::RemoteOperationCallerImpl< OperationCallerT >::collectIfDone_impl(), RTT_corba_CSendHandle_i::ret(), and RTT::internal::RemoteOperationCallerImpl< OperationCallerT >::ret_impl().
OperationInterfacePart * RTT::internal::SendHandleC::getOrp | ( | ) |
Get the contained OperationInterfacePart for SendHandle.
Definition at line 284 of file SendHandleC.cpp.
References RTT::internal::SendHandleC::E::orp.
DataSourceBase::shared_ptr RTT::internal::SendHandleC::getSendHandleDataSource | ( | ) |
Get the contained data source for send handle.
Definition at line 282 of file SendHandleC.cpp.
References RTT::internal::SendHandleC::E::s.
SendHandleC & RTT::internal::SendHandleC::operator= | ( | const SendHandleC & | other | ) |
A SendHandleC is assignable.
Definition at line 185 of file SendHandleC.cpp.
References RTT::internal::SendHandleC::E::b, RTT::internal::SendHandleC::E::mop, RTT::internal::SendHandleC::E::mopkeeper, RTT::internal::SendHandleC::E::orp, and RTT::internal::SendHandleC::E::s.
bool RTT::internal::SendHandleC::ready | ( | ) | const |
Returns true if this handle is ready for execution.
Definition at line 261 of file SendHandleC.cpp.
References RTT::internal::SendHandleC::E::s.
Referenced by RTT_corba_CSendHandle_i::RTT_corba_CSendHandle_i().
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.
Definition at line 266 of file SendHandleC.cpp.
References RTT::internal::SendHandleC::E::mopkeeper.
Referenced by RTT::internal::RemoteOperationCaller< OperationCallerT >::RemoteOperationCaller(), and RTT_corba_COperationInterface_i::sendOperation().