Orocos Real-Time Toolkit  2.9.0
Public Types | Public Member Functions | List of all members
RTT::mqueue::MQSerializationProtocol< T > Class Template Reference

#include <rtt/transports/mqueue/MQSerializationProtocol.hpp>

Inheritance diagram for RTT::mqueue::MQSerializationProtocol< T >:
RTT::mqueue::MQTemplateProtocolBase< T > RTT::types::TypeMarshaller RTT::types::TypeTransporter

Public Types

typedef T UserType
 The given T parameter is the type for reading DataSources. More...
 

Public Member Functions

 MQSerializationProtocol ()
 
virtual std::pair< void const *, int > fillBlob (base::DataSourceBase::shared_ptr source, void *blob, int size, void *cookie) const
 Create an transportable object for a protocol which contains the value of source. More...
 
virtual bool updateFromBlob (const void *blob, int size, base::DataSourceBase::shared_ptr target, void *cookie) const
 Update target with the contents of blob which is an object of a protocol. More...
 
virtual unsigned int getSampleSize (base::DataSourceBase::shared_ptr sample, void *cookie) const
 Returns the size in bytes of a marshalled data element. More...
 
virtual base::ChannelElementBase::shared_ptr createStream (base::PortInterface *port, const ConnPolicy &policy, bool is_sender) const
 Creates a streaming channel element for reading or writing over this transport. More...
 
virtual void * createCookie () const
 Overload in subclasses for marshallers that need to allocate some internal data. More...
 
virtual void deleteCookie (void *cookie) const
 Called to delete a cookie created with createCookie. More...
 

Detailed Description

template<class T>
class RTT::mqueue::MQSerializationProtocol< T >

Definition at line 61 of file MQSerializationProtocol.hpp.

Member Typedef Documentation

template<class T >
typedef T RTT::mqueue::MQTemplateProtocolBase< T >::UserType
inherited

The given T parameter is the type for reading DataSources.

Definition at line 67 of file MQTemplateProtocolBase.hpp.

Constructor & Destructor Documentation

Definition at line 65 of file MQSerializationProtocol.hpp.

Member Function Documentation

virtual void* RTT::types::TypeMarshaller::createCookie ( ) const
inlinevirtualinherited

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.

Referenced by RTT::mqueue::MQSendRecv::setupStream().

template<class T >
virtual base::ChannelElementBase::shared_ptr RTT::mqueue::MQTemplateProtocolBase< T >::createStream ( base::PortInterface port,
const ConnPolicy policy,
bool  is_sender 
) const
inlinevirtualinherited

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

Parameters
portThe port for which this channel is setup.
channel_idIf 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_senderSet to true in case you will write() to this channel element, set it to false in case you will read() from this channel element.
Returns
null in case streaming is not supported by this transport or a valid channel element otherwise.

Implements RTT::types::TypeTransporter.

Definition at line 69 of file MQTemplateProtocolBase.hpp.

References RTT::types::TypeInfo::buildDataStorage(), RTT::Error, RTT::internal::DataSourceTypeInfo< T >::getTypeInfo(), and RTT::ConnPolicy::PULL.

virtual void RTT::types::TypeMarshaller::deleteCookie ( void *  cookie) const
inlinevirtualinherited
template<class T >
virtual std::pair<void const*,int> RTT::mqueue::MQSerializationProtocol< T >::fillBlob ( base::DataSourceBase::shared_ptr  source,
void *  blob,
int  size,
void *  cookie 
) const
inlinevirtual

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

Parameters
sourceThe data to be read
blobSuggested 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.
sizeThe size of the memory area pointed by blob
Returns
Returns (0,0) if the filling failed, otherwise, points to the filled memory area and the effectively written size. The returned pointer may differ from blob, in case blob was not used. The returned size must be lower or equal than size

Implements RTT::types::TypeMarshaller.

Definition at line 68 of file MQSerializationProtocol.hpp.

References RTT::mqueue::binary_data_oarchive::getArchiveSize(), and RTT::internal::DataSource< T >::rvalue().

template<class T >
virtual unsigned int RTT::mqueue::MQSerializationProtocol< T >::getSampleSize ( base::DataSourceBase::shared_ptr  sample,
void *  cookie 
) const
inlinevirtual

Returns the size in bytes of a marshalled data element.

Returns
the size.

Implements RTT::types::TypeMarshaller.

Definition at line 98 of file MQSerializationProtocol.hpp.

References RTT::Error, RTT::internal::DataSource< T >::get(), and RTT::mqueue::binary_data_oarchive::getArchiveSize().

template<class T >
virtual bool RTT::mqueue::MQSerializationProtocol< T >::updateFromBlob ( const void *  blob,
int  size,
base::DataSourceBase::shared_ptr  target,
void *  cookie 
) const
inlinevirtual

Update target with the contents of blob which is an object of a protocol.

Implements RTT::types::TypeMarshaller.

Definition at line 86 of file MQSerializationProtocol.hpp.

References RTT::internal::AssignableDataSource< T >::narrow(), and RTT::internal::AssignableDataSource< T >::set().


The documentation for this class was generated from the following file: