#include <MQChannelElement.hpp>
Implements the a ChannelElement using message queues. It converts the C++ calls into MQ messages and vice versa.
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.
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.
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.
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.
RTT::mqueue::MQChannelElement< T >::~MQChannelElement | ( | ) | [inline] |
Definition at line 65 of file install/include/rtt/transports/mqueue/MQChannelElement.hpp.
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.
transport | The type specific object that will be used to marshal the data. |
Definition at line 54 of file rtt/transports/mqueue/MQChannelElement.hpp.
RTT::mqueue::MQChannelElement< T >::~MQChannelElement | ( | ) | [inline] |
Definition at line 65 of file rtt/transports/mqueue/MQChannelElement.hpp.
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.
virtual bool RTT::mqueue::MQChannelElement< T >::data_sample | ( | typename base::ChannelElement< T >::param_t | sample | ) | [inline, virtual] |
Definition at line 80 of file install/include/rtt/transports/mqueue/MQChannelElement.hpp.
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.
Reimplemented from RTT::base::ChannelElementBase.
Definition at line 69 of file rtt/transports/mqueue/MQChannelElement.hpp.
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.
Reimplemented from RTT::base::ChannelElementBase.
Definition at line 69 of file install/include/rtt/transports/mqueue/MQChannelElement.hpp.
FlowStatus RTT::mqueue::MQChannelElement< T >::read | ( | typename base::ChannelElement< T >::reference_t | sample, | |
bool | copy_old_data | |||
) | [inline] |
Read from the message queue.
sample | stores the resulting data sample. |
Definition at line 136 of file rtt/transports/mqueue/MQChannelElement.hpp.
FlowStatus RTT::mqueue::MQChannelElement< T >::read | ( | typename base::ChannelElement< T >::reference_t | sample, | |
bool | copy_old_data | |||
) | [inline] |
Read from the message queue.
sample | stores the resulting data sample. |
Definition at line 136 of file install/include/rtt/transports/mqueue/MQChannelElement.hpp.
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.
Reimplemented from RTT::base::ChannelElementBase.
Definition at line 112 of file rtt/transports/mqueue/MQChannelElement.hpp.
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.
Reimplemented from RTT::base::ChannelElementBase.
Definition at line 112 of file install/include/rtt/transports/mqueue/MQChannelElement.hpp.
bool RTT::mqueue::MQChannelElement< T >::write | ( | typename base::ChannelElement< T >::param_t | sample | ) | [inline] |
Write to the message queue
sample | the data sample to write |
Definition at line 146 of file rtt/transports/mqueue/MQChannelElement.hpp.
bool RTT::mqueue::MQChannelElement< T >::write | ( | typename base::ChannelElement< T >::param_t | sample | ) | [inline] |
Write to the message queue
sample | the data sample to write |
Definition at line 146 of file install/include/rtt/transports/mqueue/MQChannelElement.hpp.
internal::ValueDataSource< T >::shared_ptr RTT::mqueue::MQChannelElement< T >::read_sample [private] |
Used as a temporary on the reading side
Definition at line 45 of file install/include/rtt/transports/mqueue/MQChannelElement.hpp.
internal::LateConstReferenceDataSource< T >::shared_ptr RTT::mqueue::MQChannelElement< T >::write_sample [private] |
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.