#include <MQChannelElement.hpp>
Private Attributes | |
internal::ValueDataSource< T >::shared_ptr | read_sample |
internal::LateConstReferenceDataSource< T >::shared_ptr | write_sample |
Additional Inherited Members | |
Public Types inherited from RTT::base::ChannelElement< T > | |
typedef boost::call_traits< T >::param_type | param_t |
typedef boost::call_traits< T >::reference | reference_t |
typedef boost::intrusive_ptr< ChannelElement< T > > | shared_ptr |
typedef T | value_t |
Public Types inherited from RTT::base::ChannelElementBase | |
typedef boost::intrusive_ptr< ChannelElementBase > | shared_ptr |
Static Public Member Functions inherited from RTT::base::ChannelElementBase | |
template<typename T > | |
static ChannelElement< T > * | narrow (ChannelElementBase *e) |
Protected Member Functions inherited from RTT::base::ChannelElementBase | |
virtual bool | addInput (shared_ptr const &input) |
virtual bool | addOutput (shared_ptr const &output, bool mandatory=true) |
void | deref () |
void | ref () |
virtual void | removeInput (shared_ptr const &input) |
virtual void | removeOutput (shared_ptr const &output) |
Protected Attributes inherited from RTT::base::ChannelElementBase | |
shared_ptr | input |
RTT::os::SharedMutex | input_lock |
shared_ptr | output |
RTT::os::SharedMutex | output_lock |
Protected Attributes inherited from RTT::mqueue::MQSendRecv | |
char * | buf |
void * | marshaller_cookie |
int | max_size |
int | mdata_size |
bool | minit_done |
bool | mis_sender |
mqd_t | mqdes |
std::string | mqname |
types::TypeMarshaller const & | mtransport |
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 62 of file MQChannelElement.hpp.
|
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 74 of file MQChannelElement.hpp.
|
inline |
Definition at line 85 of file MQChannelElement.hpp.
|
inlinevirtual |
Definition at line 99 of file MQChannelElement.hpp.
|
inlinevirtual |
Returns the class name of this element. This is primary useful for special case handling in the connection tracking.
Reimplemented from RTT::base::ChannelElementBase.
Definition at line 196 of file MQChannelElement.hpp.
|
inlinevirtual |
This function return the URI of this element. The URI must be unique.
Reimplemented from RTT::base::ChannelElementBase.
Definition at line 186 of file MQChannelElement.hpp.
|
inlinevirtual |
This function returns the URI of the next channel element in the logical chain. The URI must be unique. E.g: In the local case output->getLocalURI() In the remote case the URI of the remote channel element.
Reimplemented from RTT::base::ChannelElementBase.
Definition at line 176 of file MQChannelElement.hpp.
|
inlinevirtual |
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 89 of file MQChannelElement.hpp.
|
inlinevirtual |
This function may be used to identify, if the current element uses a network transport, to send the data to the next Element in the logical chain.
Reimplemented from RTT::base::ChannelElementBase.
Definition at line 171 of file MQChannelElement.hpp.
|
inline |
Read from the message queue.
sample | stores the resulting data sample. |
Definition at line 152 of file MQChannelElement.hpp.
|
inlinevirtual |
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 128 of file MQChannelElement.hpp.
|
inline |
Write to the message queue
sample | the data sample to write |
Definition at line 162 of file MQChannelElement.hpp.
|
private |
Used as a temporary on the reading side
Definition at line 65 of file MQChannelElement.hpp.
|
private |
Used in write() to refer to the sample that needs to be written
Definition at line 67 of file MQChannelElement.hpp.