cc_tools_qt
Common Environment for Protocol Analysis.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | List of all members
cc_tools_qt::Message Class Referenceabstract

#include "cc_tools_qt/Message.h"

Detailed Description

Main interface class used by CommsChampion Tools to display and manipulate messages.

Inheritance diagram for cc_tools_qt::Message:
cc_tools_qt::MessageBase< TMessageBase, TOptions >

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.
 

Member Enumeration Documentation

◆ Type

enum class cc_tools_qt::Message::Type
strong

Type of the message.

Enumerator
Invalid 

Invalid type.

Received 

Message has been received.

Sent 

Message has been sent.

NumOfValues 

Number of available values.

Constructor & Destructor Documentation

◆ ~Message()

virtual cc_tools_qt::Message::~Message ( )
virtualnoexcept

Destructor.

virtual to allow polymorphic destruction

Member Function Documentation

◆ assign()

bool cc_tools_qt::Message::assign ( const Message other)

Assign contents of other message to this ones.

Returns
true in case the messages are of the same type and the assignement is successful, false othewise. Invokes assignImpl().

◆ assignImpl()

virtual bool cc_tools_qt::Message::assignImpl ( const Message other)
protectedpure virtual

Polymophic assignment functionality.

Invoked by assign().

◆ decodeData()

bool cc_tools_qt::Message::decodeData ( const DataSeq data)

Decode (or deserialise) message contents.

Invokes decodeDataImpl().

◆ decodeDataImpl()

virtual bool cc_tools_qt::Message::decodeDataImpl ( const DataSeq data)
protectedpure virtual

Polymorphic deserialisation functionality.

Invoked by decodeData().

Implemented in cc_tools_qt::MessageBase< TMessageBase, TOptions >.

◆ dispatch()

void cc_tools_qt::Message::dispatch ( MessageHandler handler)

Dispatch message to message handler used by CommsChampion Tools

Invokes dispatchImpl()

◆ dispatchImpl()

virtual void cc_tools_qt::Message::dispatchImpl ( MessageHandler handler)
protectedpure virtual

Polymorphic dispatch functionality.

Invoked by dispatch().

◆ encodeData()

DataSeq cc_tools_qt::Message::encodeData ( ) const

Encode (or serialise) message contents.

Invokes encodeDataImpl().

◆ encodeDataImpl()

virtual DataSeq cc_tools_qt::Message::encodeDataImpl ( ) const
protectedpure virtual

Polymorphic serialisation functionality.

Invoked by encodeData().

Implemented in cc_tools_qt::MessageBase< TMessageBase, TOptions >.

◆ extraTransportFieldsProperties()

const QVariantList & cc_tools_qt::Message::extraTransportFieldsProperties ( ) const

Get properties describing message extra transport fields.

Invokes extraTransportFieldsPropertiesImpl()

◆ extraTransportFieldsPropertiesImpl()

virtual const QVariantList & cc_tools_qt::Message::extraTransportFieldsPropertiesImpl ( ) const
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().

◆ fieldsProperties()

const QVariantList & cc_tools_qt::Message::fieldsProperties ( ) const

Get properties describing message fields.

Invokes fieldsPropertiesImpl()

◆ fieldsPropertiesImpl()

virtual const QVariantList & cc_tools_qt::Message::fieldsPropertiesImpl ( ) const
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().

◆ idAsString()

QString cc_tools_qt::Message::idAsString ( ) const

Get string representation of message ID.

Invokes idAsStringImpl().

◆ idAsStringImpl()

virtual QString cc_tools_qt::Message::idAsStringImpl ( ) const
protectedpure virtual

Polymophic functionality to get string representation of message ID.

Invoked by idAsString().

Implemented in cc_tools_qt::MessageBase< TMessageBase, TOptions >.

◆ isValid()

bool cc_tools_qt::Message::isValid ( ) const

Check the message contents are valid.

Invokes isValidImpl().

◆ isValidImpl()

virtual bool cc_tools_qt::Message::isValidImpl ( ) const
protectedpure virtual

Polymorphic validity check functionality.

Invoked by isValid().

Implemented in cc_tools_qt::MessageBase< TMessageBase, TOptions >.

◆ name()

const char * cc_tools_qt::Message::name ( ) const

Get message name.

Invokes virtual nameImpl().

◆ nameImpl()

virtual const char * cc_tools_qt::Message::nameImpl ( ) const
protectedpure virtual

Polymorphic name retrieval functionality.

Invoked by name().

◆ refreshMsg()

bool cc_tools_qt::Message::refreshMsg ( )

Refresh message contents.

Needs to be invoked by the CommsChampion Tools when some field get modified. Invokes refreshMsgImpl().

Returns
true, if message contentes where refreshed (other fields changed).

◆ refreshMsgImpl()

virtual bool cc_tools_qt::Message::refreshMsgImpl ( )
protectedpure virtual

Polymorphic refresh functionality.

Invoked by refresh().

Implemented in cc_tools_qt::MessageBase< TMessageBase, TOptions >.

◆ resetImpl()

virtual void cc_tools_qt::Message::resetImpl ( )
protectedpure virtual

Polymorphic reset functionality.

Invoked by reset().


The documentation for this class was generated from the following file: