#include <mq_send_recv.hpp>
Public Member Functions | |
void | cleanupStream () |
virtual void | mqNewSample (int size) |
bool | mqRead (SerializedMessage &m) |
virtual bool | mqReady (ChannelElementBase *chan) |
MQSendRecv () | |
bool | mqWrite (SerializedMessage &m) |
void | setupStream (ConnectionBasePtr connection, int size, bool is_sender) |
~MQSendRecv () | |
Protected Attributes | |
char * | buf |
int | max_size |
int | mdata_size |
bool | minit_done |
bool | mis_sender |
mqd_t | mqdes |
std::string | mqname |
Implements the sending/receiving of mqueue messages. It can only be OR sender OR receiver (logical XOR).
Definition at line 36 of file mq_send_recv.hpp.
Create a channel element for remote data exchange.
transport | The type specific object that will be used to marshal the data. |
Definition at line 38 of file mq_send_recv.cpp.
Definition at line 111 of file mq_send_recv.cpp.
Definition at line 118 of file mq_send_recv.cpp.
void micros_rtt::MQSendRecv::mqNewSample | ( | int | size | ) | [virtual] |
Adapts the mq send/receive buffer size according to the data in mqdata_source, or the value set in mdata_size;
sample |
Definition at line 144 of file mq_send_recv.cpp.
bool micros_rtt::MQSendRecv::mqRead | ( | SerializedMessage & | m | ) |
Read from the message queue.
sample | stores the resulting data sample. |
Definition at line 174 of file mq_send_recv.cpp.
bool micros_rtt::MQSendRecv::mqReady | ( | ChannelElementBase * | chan | ) | [virtual] |
Works only in receive mode, waits for a new sample and adapts the receive buffer to match it's size.
Definition at line 154 of file mq_send_recv.cpp.
bool micros_rtt::MQSendRecv::mqWrite | ( | SerializedMessage & | m | ) |
Write to the message queue
ds | the data sample to write |
is_data_sample | true if the sample is used for initialization, false if it is a proper write |
Definition at line 193 of file mq_send_recv.cpp.
void micros_rtt::MQSendRecv::setupStream | ( | ConnectionBasePtr | connection, |
int | size, | ||
bool | is_sender | ||
) |
Definition at line 43 of file mq_send_recv.cpp.
char* micros_rtt::MQSendRecv::buf [protected] |
Send/Receive buffer. It is initialized to the size of the value provided by the ConnPolicy or, if the policy has a zero data size, the sample given to setupStream
Its size is saved in max_size
Definition at line 51 of file mq_send_recv.hpp.
int micros_rtt::MQSendRecv::max_size [protected] |
The size of buf.
Definition at line 63 of file mq_send_recv.hpp.
int micros_rtt::MQSendRecv::mdata_size [protected] |
The size of the data, as specified in the ConnPolicy when creating the stream, or calculated using the transport when that size was zero.
Definition at line 74 of file mq_send_recv.hpp.
bool micros_rtt::MQSendRecv::minit_done [protected] |
True if setupStream() was called, false after cleanupStream().
Definition at line 59 of file mq_send_recv.hpp.
bool micros_rtt::MQSendRecv::mis_sender [protected] |
True if this object is a sender.
Definition at line 55 of file mq_send_recv.hpp.
mqd_t micros_rtt::MQSendRecv::mqdes [protected] |
MQueue file descriptor.
Definition at line 43 of file mq_send_recv.hpp.
std::string micros_rtt::MQSendRecv::mqname [protected] |
The name of the queue, as specified in the ConnPolicy when creating the stream, or self-calculated when that name was empty.
Definition at line 68 of file mq_send_recv.hpp.