cc_tools_qt
Common Environment for Protocol Analysis.
|
#include "cc_tools_qt/MessageBase.h"
Helper class used to define protocol message interface class in CommsChampion Tools plugin environment.
Extends comms::Message as well as provided interface class, while passing required options to the latter.
TMessageBase | Name of the interface class defined for custom protocol. Expected to inherit (or typedef) from comms::Message and have the following definition: template <typename... TOptions>
class MyInterfaceClass : public comms::Message<...> {...};
|
TOptions | Any extra options to be passed the the interface class |
Public Types | |
using | DataSeq = std::vector< std::uint8_t > |
Type for sequence of raw bytes. | |
using | Handler = typename CommsBase::Handler |
Handler class. | |
enum class | Type { Invalid , Received , Sent , NumOfValues } |
Type of the message. More... | |
Public Member Functions | |
MessageBase ()=default | |
Default constructor. | |
MessageBase (const MessageBase &)=default | |
Copy Constructor. | |
MessageBase (MessageBase &&)=default | |
Move Constructor. | |
~MessageBase () noexcept=default | |
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. | |
MessageBase & | operator= (const MessageBase &other) |
Copy assignment operator. | |
MessageBase & | operator= (MessageBase &&other) |
Move assignment operator. | |
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) override |
Overriding polymorphic deserialisation functionaly. | |
virtual void | dispatchImpl (MessageHandler &handler)=0 |
Polymorphic dispatch functionality. | |
virtual DataSeq | encodeDataImpl () const override |
Overriding polymorphic serialisation functionaly. | |
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 override |
Overriding polymorphic retrieval of the id string. | |
virtual bool | isValidImpl () const override |
Overriding polymorphic validity check. | |
virtual const char * | nameImpl () const =0 |
Polymorphic name retrieval functionality. | |
virtual bool | refreshMsgImpl () override |
Overriding polymorphic refresh functionality. | |
virtual void | resetImpl ()=0 |
Polymorphic reset functionality. | |
using cc_tools_qt::MessageBase< TMessageBase, TOptions >::Handler = typename CommsBase::Handler |
Handler class.
|
stronginherited |
|
inherited |
Assign contents of other message to this ones.
|
protectedpure virtualinherited |
Polymophic assignment functionality.
Invoked by assign().
|
inherited |
Decode (or deserialise) message contents.
Invokes decodeDataImpl().
|
overrideprotectedvirtual |
Overriding polymorphic deserialisation functionaly.
Invokes read() inherited from provided interface class.
Implements cc_tools_qt::Message.
|
inherited |
Dispatch message to message handler used by CommsChampion Tools
Invokes dispatchImpl()
|
protectedpure virtualinherited |
Polymorphic dispatch functionality.
Invoked by dispatch().
|
inherited |
Encode (or serialise) message contents.
Invokes encodeDataImpl().
|
overrideprotectedvirtual |
Overriding polymorphic serialisation functionaly.
Invokes write() inherited from provided interface class.
Implements cc_tools_qt::Message.
|
inherited |
Get properties describing message extra transport fields.
|
protectedvirtualinherited |
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().
|
inherited |
Get properties describing message fields.
Invokes fieldsPropertiesImpl()
|
protectedvirtualinherited |
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().
|
inherited |
Get string representation of message ID.
Invokes idAsStringImpl().
|
overrideprotectedvirtual |
Overriding polymorphic retrieval of the id string.
Invokes getId inherited from the provided interface class and converts it to string.
Implements cc_tools_qt::Message.
|
inherited |
Check the message contents are valid.
Invokes isValidImpl().
|
overrideprotectedvirtual |
Overriding polymorphic validity check.
Invokes valid() inherited from provided interface class.
Implements cc_tools_qt::Message.
|
inherited |
Get message name.
Invokes virtual nameImpl().
|
protectedpure virtualinherited |
Polymorphic name retrieval functionality.
Invoked by name().
|
inherited |
Refresh message contents.
Needs to be invoked by the CommsChampion Tools when some field get modified. Invokes refreshMsgImpl().
|
overrideprotectedvirtual |
Overriding polymorphic refresh functionality.
Invokes refresh() inherited from the provided interface class
Implements cc_tools_qt::Message.
|
protectedpure virtualinherited |
Polymorphic reset functionality.
Invoked by reset().