cc_tools_qt
Common Environment for Protocol Analysis.
|
#include "cc_tools_qt/Message.h"
Main interface class used by CommsChampion Tools to display and manipulate messages.
Public Types | |
using | DataSeq = std::vector< std::uint8_t > |
Type for sequence of raw bytes. | |
enum class | Type { Invalid , Received , Sent , NumOfValues } |
Type of the message. More... | |
Public Member Functions | |
virtual | ~Message () noexcept |
Destructor. | |
bool | assign (const Message &other) |
Assign contents of other message to this ones. | |
bool | decodeData (const DataSeq &data) |
Decode (or deserialise) message contents. | |
void | dispatch (MessageHandler &handler) |
Dispatch message to message handler used by CommsChampion Tools | |
DataSeq | encodeData () const |
Encode (or serialise) message contents. | |
const QVariantList & | extraTransportFieldsProperties () const |
Get properties describing message extra transport fields. | |
const QVariantList & | fieldsProperties () const |
Get properties describing message fields. | |
QString | idAsString () const |
Get string representation of message ID. | |
bool | isValid () const |
Check the message contents are valid. | |
const char * | name () const |
Get message name. | |
bool | refreshMsg () |
Refresh message contents. | |
void | reset () |
Reset message contents to default constructed values. | |
Protected Member Functions | |
virtual bool | assignImpl (const Message &other)=0 |
Polymophic assignment functionality. | |
virtual bool | decodeDataImpl (const DataSeq &data)=0 |
Polymorphic deserialisation functionality. | |
virtual void | dispatchImpl (MessageHandler &handler)=0 |
Polymorphic dispatch functionality. | |
virtual DataSeq | encodeDataImpl () const =0 |
Polymorphic serialisation functionality. | |
virtual const QVariantList & | extraTransportFieldsPropertiesImpl () const |
Polymorphic extra transport fields properties retrieval function. | |
virtual const QVariantList & | fieldsPropertiesImpl () const |
Polymorphic fields properties retrieval function. | |
virtual QString | idAsStringImpl () const =0 |
Polymophic functionality to get string representation of message ID. | |
virtual bool | isValidImpl () const =0 |
Polymorphic validity check functionality. | |
virtual const char * | nameImpl () const =0 |
Polymorphic name retrieval functionality. | |
virtual bool | refreshMsgImpl ()=0 |
Polymorphic refresh functionality. | |
virtual void | resetImpl ()=0 |
Polymorphic reset functionality. | |
|
strong |
|
virtualnoexcept |
Destructor.
virtual to allow polymorphic destruction
bool cc_tools_qt::Message::assign | ( | const Message & | other | ) |
Assign contents of other message to this ones.
|
protectedpure virtual |
Polymophic assignment functionality.
Invoked by assign().
bool cc_tools_qt::Message::decodeData | ( | const DataSeq & | data | ) |
Decode (or deserialise) message contents.
Invokes decodeDataImpl().
|
protectedpure virtual |
Polymorphic deserialisation functionality.
Invoked by decodeData().
Implemented in cc_tools_qt::MessageBase< TMessageBase, TOptions >.
void cc_tools_qt::Message::dispatch | ( | MessageHandler & | handler | ) |
Dispatch message to message handler used by CommsChampion Tools
Invokes dispatchImpl()
|
protectedpure virtual |
Polymorphic dispatch functionality.
Invoked by dispatch().
DataSeq cc_tools_qt::Message::encodeData | ( | ) | const |
Encode (or serialise) message contents.
Invokes encodeDataImpl().
|
protectedpure virtual |
Polymorphic serialisation functionality.
Invoked by encodeData().
Implemented in cc_tools_qt::MessageBase< TMessageBase, TOptions >.
const QVariantList & cc_tools_qt::Message::extraTransportFieldsProperties | ( | ) | const |
Get properties describing message extra transport fields.
|
protectedvirtual |
Polymorphic extra transport fields properties retrieval function.
Default implementation returns empty list, should be overriden by the derived classes if message contains at least one extra transport field. Invoked by extraTransportFieldsProperties().
const QVariantList & cc_tools_qt::Message::fieldsProperties | ( | ) | const |
Get properties describing message fields.
Invokes fieldsPropertiesImpl()
|
protectedvirtual |
Polymorphic fields properties retrieval function.
Default implementation returns empty list, should be overriden by the derived classes if message contains at least one field. Invoked by fieldsProperties().
QString cc_tools_qt::Message::idAsString | ( | ) | const |
Get string representation of message ID.
Invokes idAsStringImpl().
|
protectedpure virtual |
Polymophic functionality to get string representation of message ID.
Invoked by idAsString().
Implemented in cc_tools_qt::MessageBase< TMessageBase, TOptions >.
bool cc_tools_qt::Message::isValid | ( | ) | const |
Check the message contents are valid.
Invokes isValidImpl().
|
protectedpure virtual |
Polymorphic validity check functionality.
Invoked by isValid().
Implemented in cc_tools_qt::MessageBase< TMessageBase, TOptions >.
const char * cc_tools_qt::Message::name | ( | ) | const |
Get message name.
Invokes virtual nameImpl().
|
protectedpure virtual |
Polymorphic name retrieval functionality.
Invoked by name().
bool cc_tools_qt::Message::refreshMsg | ( | ) |
Refresh message contents.
Needs to be invoked by the CommsChampion Tools when some field get modified. Invokes refreshMsgImpl().
|
protectedpure virtual |
Polymorphic refresh functionality.
Invoked by refresh().
Implemented in cc_tools_qt::MessageBase< TMessageBase, TOptions >.
|
protectedpure virtual |
Polymorphic reset functionality.
Invoked by reset().