|
Orocos Real-Time Toolkit
2.6.0
|
Objects implementing this interface have the capability to convert data sources to and from a binary representation. More...
#include <rtt/types/TypeMarshaller.hpp>
Public Member Functions | |
| virtual void * | createCookie () const |
| Overload in subclasses for marshallers that need to allocate some internal data. | |
| virtual void | deleteCookie (void *cookie) const |
| Called to delete a cookie created with createCookie. | |
| virtual std::pair< void const *, int > | fillBlob (base::DataSourceBase::shared_ptr source, void *blob, int size, void *cookie=0) const =0 |
| Create an transportable object for a protocol which contains the value of source. | |
| virtual bool | updateFromBlob (const void *blob, int size, base::DataSourceBase::shared_ptr target, void *cookie=0) const =0 |
| Update target with the contents of blob which is an object of a protocol. | |
| virtual unsigned int | getSampleSize (base::DataSourceBase::shared_ptr sample, void *cookie=0) const =0 |
| Returns the size in bytes of a marshalled data element. | |
| virtual base::ChannelElementBase::shared_ptr | createStream (base::PortInterface *port, const ConnPolicy &policy, bool is_sender) const =0 |
| Creates a streaming channel element for reading or writing over this transport. | |
Objects implementing this interface have the capability to convert data sources to and from a binary representation.
Definition at line 61 of file TypeMarshaller.hpp.
| virtual void* RTT::types::TypeMarshaller::createCookie | ( | ) | const [inline, virtual] |
Overload in subclasses for marshallers that need to allocate some internal data.
The protocol will call deleteCookie(void*) accordingly
Definition at line 68 of file TypeMarshaller.hpp.
| virtual base::ChannelElementBase::shared_ptr RTT::types::TypeTransporter::createStream | ( | base::PortInterface * | port, |
| const ConnPolicy & | policy, | ||
| bool | is_sender | ||
| ) | const [pure virtual, inherited] |
Creates a streaming channel element for reading or writing over this transport.
It returns a ChannelElementBase that provides the implementation of sending or receiving data through the transport. Both sender and receiver find each other using the channel_id argument. Transports that do not support streaming may return null
| port | The port for which this channel is setup. |
| channel_id | If the transport receives a non-empty channel_id, it will create a channel that connects to this id. If channel id is empty, it will be filled in with a unique identifier that identifies this channel. This allows the local caller to connect to the remote channel in a second invocation of createRemoteChannel. |
| is_sender | Set to true in case you will write() to this channel element, set it to false in case you will read() from this channel element. |
Implemented in RTT::corba::CorbaFallBackProtocol, RTT::mqueue::MQTemplateProtocol< T >, and RTT::corba::CorbaTypeTransporter.
Referenced by RTT::corba::RemoteInputPort::buildRemoteChannelOutput(), and RTT::internal::ConnFactory::createAndCheckStream().
| virtual std::pair<void const*,int> RTT::types::TypeMarshaller::fillBlob | ( | base::DataSourceBase::shared_ptr | source, |
| void * | blob, | ||
| int | size, | ||
| void * | cookie = 0 |
||
| ) | const [pure virtual] |
Create an transportable object for a protocol which contains the value of source.
This must be a real-time function which does not allocate memory
| source | The data to be read |
| blob | Suggested target memory area to write to. In case the type marshaller does not need this, it will return an alternative as a first element in the returned std::pair. |
| size | The size of the memory area pointed by blob |
size Implemented in RTT::mqueue::MQTemplateProtocol< T >.
Referenced by RTT::mqueue::MQSendRecv::mqWrite().
| virtual unsigned int RTT::types::TypeMarshaller::getSampleSize | ( | base::DataSourceBase::shared_ptr | sample, |
| void * | cookie = 0 |
||
| ) | const [pure virtual] |
Returns the size in bytes of a marshalled data element.
Implemented in RTT::mqueue::MQTemplateProtocol< T >.
Referenced by RTT::internal::ConnFactory::createAndCheckStream(), and RTT::mqueue::MQSendRecv::mqNewSample().
| virtual bool RTT::types::TypeMarshaller::updateFromBlob | ( | const void * | blob, |
| int | size, | ||
| base::DataSourceBase::shared_ptr | target, | ||
| void * | cookie = 0 |
||
| ) | const [pure virtual] |
Update target with the contents of blob which is an object of a protocol.
The given data source is guaranteed to be an AssignableDataSource
Implemented in RTT::mqueue::MQTemplateProtocol< T >.
Referenced by RTT::mqueue::MQSendRecv::mqRead(), and RTT::mqueue::MQSendRecv::mqReady().
1.7.6.1