OpenCurves
0.9
|
Base message handling for real time data plot communications. More...
#include <rtmessage.h>
Public Member Functions | |
virtual | ~RTMessage () |
Virtual destructor. | |
virtual void | setMessage (QByteArray &buffer)=0 |
Called to fill out the send buffer with the contained message. More... | |
virtual int | readMessage (const QByteArray &buffer)=0 |
Called to read incoming data from the given buffer. More... | |
virtual QStringList | headings () const =0 |
Request the list of headings for the plot. More... | |
virtual unsigned | populateValues (std::vector< double > &values) const =0 |
Request the latest values. More... | |
Base message handling for real time data plot communications.
Implementations support reading and writing messages for real-time plot communications. There are two key implementations; RTStringMessage and RTBinaryMessage.
For sending, only setMessage()
is called. For reading, the sequence is:
readMessage()
to populate this instance with data from the message buffer.populateValues()
to get the latest values.headings()
to determine the headingsThe headings()
stops once a valid set of headings is returned. This is to support string based messaging where the number of headings is not given in advance, but stops requesting headings once known.
|
pure virtual |
Request the list of headings for the plot.
Implemented in RTBinaryMessage, and RTStringMessage.
|
pure virtual |
Request the latest values.
Uses a std::vector
, not QVector
because the former can be cleared without reallocation (at the time of writing).
values | Resized and populated to the latest values set. |
Implemented in RTBinaryMessage, and RTStringMessage.
|
pure virtual |
Called to read incoming data from the given buffer.
buffer | The buffer to read from. |
Implemented in RTBinaryMessage, and RTStringMessage.
|
pure virtual |
Called to fill out the send buffer with the contained message.
buffer | The buffer to write to. |
Implemented in RTBinaryMessage, and RTStringMessage.