RTT::mqueue::MQChannelElement< T > Class Template Reference

#include <MQChannelElement.hpp>

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

List of all members.

Public Member Functions

virtual bool data_sample (typename base::ChannelElement< T >::param_t sample)
virtual bool data_sample (typename base::ChannelElement< T >::param_t sample)
virtual bool inputReady ()
virtual bool inputReady ()
 MQChannelElement (base::PortInterface *port, types::TypeMarshaller const &transport, const ConnPolicy &policy, bool is_sender)
 MQChannelElement (base::PortInterface *port, types::TypeMarshaller const &transport, const ConnPolicy &policy, bool is_sender)
FlowStatus read (typename base::ChannelElement< T >::reference_t sample, bool copy_old_data)
FlowStatus read (typename base::ChannelElement< T >::reference_t sample, bool copy_old_data)
bool signal ()
bool signal ()
bool write (typename base::ChannelElement< T >::param_t sample)
bool write (typename base::ChannelElement< T >::param_t sample)
 ~MQChannelElement ()
 ~MQChannelElement ()

Private Attributes

internal::ValueDataSource< T >
::shared_ptr 
read_sample
internal::LateConstReferenceDataSource
< T >::shared_ptr 
write_sample

Detailed Description

template<typename T>
class RTT::mqueue::MQChannelElement< T >

Implements the a ChannelElement using message queues. It converts the C++ calls into MQ messages and vice versa.

Todo:

This class can be refactored into a base class with generic mqueue code and a subclass with type specific info.

This is an inspiration for a generic, transport independent channel element.

Implements the a ChannelElement using message queues. It converts the C++ calls into MQ messages and vice versa.

Todo:

This class can be refactored into a base class with generic mqueue code and a subclass with type specific info.

This is an inspiration for a generic, transport independent channel element.

Definition at line 53 of file install/include/rtt/transports/mqueue/MQChannelElement.hpp.


Constructor & Destructor Documentation

template<typename T>
RTT::mqueue::MQChannelElement< T >::MQChannelElement ( base::PortInterface port,
types::TypeMarshaller const &  transport,
const ConnPolicy policy,
bool  is_sender 
) [inline]

Create a channel element for remote data exchange.

Parameters:
transport The type specific object that will be used to marshal the data.

Definition at line 54 of file install/include/rtt/transports/mqueue/MQChannelElement.hpp.

template<typename T>
RTT::mqueue::MQChannelElement< T >::~MQChannelElement (  )  [inline]
template<typename T>
RTT::mqueue::MQChannelElement< T >::MQChannelElement ( base::PortInterface port,
types::TypeMarshaller const &  transport,
const ConnPolicy policy,
bool  is_sender 
) [inline]

Create a channel element for remote data exchange.

Parameters:
transport The type specific object that will be used to marshal the data.

Definition at line 54 of file rtt/transports/mqueue/MQChannelElement.hpp.

template<typename T>
RTT::mqueue::MQChannelElement< T >::~MQChannelElement (  )  [inline]

Definition at line 65 of file rtt/transports/mqueue/MQChannelElement.hpp.


Member Function Documentation

template<typename T>
virtual bool RTT::mqueue::MQChannelElement< T >::data_sample ( typename base::ChannelElement< T >::param_t  sample  )  [inline, virtual]

Definition at line 80 of file rtt/transports/mqueue/MQChannelElement.hpp.

template<typename T>
virtual bool RTT::mqueue::MQChannelElement< T >::data_sample ( typename base::ChannelElement< T >::param_t  sample  )  [inline, virtual]
template<typename T>
virtual bool RTT::mqueue::MQChannelElement< T >::inputReady (  )  [inline, virtual]

This is called by an input port when it is ready to receive data. Each channel element has the responsibility to pass this notification on to the next, in the direction of the output.

Returns:
false if a fatal connection failure was encountered and the channel needs to be destroyed.

Reimplemented from RTT::base::ChannelElementBase.

Definition at line 69 of file rtt/transports/mqueue/MQChannelElement.hpp.

template<typename T>
virtual bool RTT::mqueue::MQChannelElement< T >::inputReady (  )  [inline, virtual]

This is called by an input port when it is ready to receive data. Each channel element has the responsibility to pass this notification on to the next, in the direction of the output.

Returns:
false if a fatal connection failure was encountered and the channel needs to be destroyed.

Reimplemented from RTT::base::ChannelElementBase.

Definition at line 69 of file install/include/rtt/transports/mqueue/MQChannelElement.hpp.

template<typename T>
FlowStatus RTT::mqueue::MQChannelElement< T >::read ( typename base::ChannelElement< T >::reference_t  sample,
bool  copy_old_data 
) [inline]

Read from the message queue.

Parameters:
sample stores the resulting data sample.
Returns:
true if an item could be read.

Definition at line 136 of file rtt/transports/mqueue/MQChannelElement.hpp.

template<typename T>
FlowStatus RTT::mqueue::MQChannelElement< T >::read ( typename base::ChannelElement< T >::reference_t  sample,
bool  copy_old_data 
) [inline]

Read from the message queue.

Parameters:
sample stores the resulting data sample.
Returns:
true if an item could be read.

Definition at line 136 of file install/include/rtt/transports/mqueue/MQChannelElement.hpp.

template<typename T>
bool RTT::mqueue::MQChannelElement< T >::signal (  )  [inline, virtual]

Signal will cause a read-write cycle to transfer the data from the data/buffer element to the message queue and vice versa.

Note: this virtual function is a bit abused. For a sending MQ, signal triggers a direct read on the data element. For a receiving MQ, signal is used by the dispatcher thread to provoque a read from the MQ and forward it to the next channel element.

In the sending case, signal could trigger a dispatcher thread that does the read/write cycle, but that seems only causing overhead. The receiving case must use a thread which blocks on all mq file descriptors.

Returns:
true in case the forwarding could be done, false otherwise.

Reimplemented from RTT::base::ChannelElementBase.

Definition at line 112 of file rtt/transports/mqueue/MQChannelElement.hpp.

template<typename T>
bool RTT::mqueue::MQChannelElement< T >::signal (  )  [inline, virtual]

Signal will cause a read-write cycle to transfer the data from the data/buffer element to the message queue and vice versa.

Note: this virtual function is a bit abused. For a sending MQ, signal triggers a direct read on the data element. For a receiving MQ, signal is used by the dispatcher thread to provoque a read from the MQ and forward it to the next channel element.

In the sending case, signal could trigger a dispatcher thread that does the read/write cycle, but that seems only causing overhead. The receiving case must use a thread which blocks on all mq file descriptors.

Returns:
true in case the forwarding could be done, false otherwise.

Reimplemented from RTT::base::ChannelElementBase.

Definition at line 112 of file install/include/rtt/transports/mqueue/MQChannelElement.hpp.

template<typename T>
bool RTT::mqueue::MQChannelElement< T >::write ( typename base::ChannelElement< T >::param_t  sample  )  [inline]

Write to the message queue

Parameters:
sample the data sample to write
Returns:
true if it could be sent.

Definition at line 146 of file rtt/transports/mqueue/MQChannelElement.hpp.

template<typename T>
bool RTT::mqueue::MQChannelElement< T >::write ( typename base::ChannelElement< T >::param_t  sample  )  [inline]

Write to the message queue

Parameters:
sample the data sample to write
Returns:
true if it could be sent.

Definition at line 146 of file install/include/rtt/transports/mqueue/MQChannelElement.hpp.


Member Data Documentation

Used as a temporary on the reading side

Definition at line 45 of file install/include/rtt/transports/mqueue/MQChannelElement.hpp.

Used in write() to refer to the sample that needs to be written

Definition at line 47 of file install/include/rtt/transports/mqueue/MQChannelElement.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


rtt
Author(s): RTT Developers
autogenerated on Fri Jan 11 09:50:09 2013