Public Types | Public Member Functions
RTT::mqueue::MQTemplateProtocol< T > Class Template Reference

#include <MQTemplateProtocol.hpp>

Inheritance diagram for RTT::mqueue::MQTemplateProtocol< T >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef T UserType

Public Member Functions

 BOOST_STATIC_ASSERT (!boost::has_virtual_destructor< T >::value)
virtual
base::ChannelElementBase::shared_ptr 
createStream (base::PortInterface *port, const ConnPolicy &policy, bool is_sender) const
virtual std::pair< void const
*, int > 
fillBlob (base::DataSourceBase::shared_ptr source, void *blob, int size, void *cookie) const
virtual unsigned int getSampleSize (base::DataSourceBase::shared_ptr ignored, void *cookie) const
virtual bool updateFromBlob (const void *blob, int size, base::DataSourceBase::shared_ptr target, void *cookie) const

Detailed Description

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

For each transportable type T, specify the conversion functions.

Warning:
This can only be used if T is a trivial type without meaningful (copy) constructor. For all other cases, or in doubt, use the MQSerializationProtocol class.

Definition at line 60 of file MQTemplateProtocol.hpp.


Member Typedef Documentation

template<class T >
typedef T RTT::mqueue::MQTemplateProtocol< T >::UserType

The given T parameter is the type for reading DataSources.

Definition at line 73 of file MQTemplateProtocol.hpp.


Member Function Documentation

template<class T >
RTT::mqueue::MQTemplateProtocol< T >::BOOST_STATIC_ASSERT ( !boost::has_virtual_destructor< T >::value  )

We don't support types with virtual functions ! TODO: use this type trait to make the necessary adjustments in the memcopy (adding the vptr table offset).

template<class T >
virtual base::ChannelElementBase::shared_ptr RTT::mqueue::MQTemplateProtocol< T >::createStream ( base::PortInterface port,
const ConnPolicy policy,
bool  is_sender 
) const [inline, virtual]

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 99 of file MQTemplateProtocol.hpp.

template<class T >
virtual std::pair<void const*,int> RTT::mqueue::MQTemplateProtocol< T >::fillBlob ( base::DataSourceBase::shared_ptr  source,
void *  blob,
int  size,
void *  cookie 
) const [inline, 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

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.

Reimplemented in RTT::mqueue::MQSerializationProtocol< T >.

Definition at line 75 of file MQTemplateProtocol.hpp.

template<class T >
virtual unsigned int RTT::mqueue::MQTemplateProtocol< T >::getSampleSize ( base::DataSourceBase::shared_ptr  sample,
void *  cookie 
) const [inline, virtual]

Returns the size in bytes of a marshalled data element.

Returns:
the size.

Implements RTT::types::TypeMarshaller.

Reimplemented in RTT::mqueue::MQSerializationProtocol< T >.

Definition at line 93 of file MQTemplateProtocol.hpp.

template<class T >
virtual bool RTT::mqueue::MQTemplateProtocol< T >::updateFromBlob ( const void *  blob,
int  size,
base::DataSourceBase::shared_ptr  target,
void *  cookie 
) const [inline, 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

Implements RTT::types::TypeMarshaller.

Reimplemented in RTT::mqueue::MQSerializationProtocol< T >.

Definition at line 82 of file MQTemplateProtocol.hpp.


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


rtt
Author(s): RTT Developers
autogenerated on Mon Oct 6 2014 03:13:59