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::ToolsMessage Class Referenceabstract

#include "cc_tools_qt/ToolsMessage.h"

Detailed Description

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

Inherits QObject.

Public Types

using DataSeq = std::vector< std::uint8_t >
 Type for sequence of raw bytes.
 
using Ptr = std::unique_ptr< ToolsMessage >
 Pointer to message object.
 
enum class  Type { Invalid , Received , Sent , NumOfValues }
 Type of the message. More...
 

Public Member Functions

virtual ~ToolsMessage () noexcept
 Destructor.
 
bool assign (const ToolsMessage &other)
 Assign contents of other message to this ones.
 
bool decodeData (const DataSeq &data)
 Decode (or deserialise) message contents.
 
DataSeq encodeData () const
 Encode (or serialise) message contents.
 
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 ToolsMessage &other)=0
 Polymophic assignment functionality.
 
virtual bool decodeDataImpl (const DataSeq &data)=0
 Polymorphic deserialisation functionality.
 
virtual DataSeq encodeDataImpl () const =0
 Polymorphic serialisation functionality.
 
virtual QString idAsStringImpl () const
 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 qlonglong numericIdImpl () const =0
 Polymophic functionality to get numeric message ID.
 
virtual bool refreshMsgImpl ()=0
 Polymorphic refresh functionality.
 
virtual void resetImpl ()=0
 Polymorphic reset functionality.
 

Member Enumeration Documentation

◆ Type

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

◆ ~ToolsMessage()

cc_tools_qt::ToolsMessage::~ToolsMessage ( )
virtualdefaultnoexcept

Destructor.

virtual to allow polymorphic destruction

Member Function Documentation

◆ assign()

bool cc_tools_qt::ToolsMessage::assign ( const ToolsMessage 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::ToolsMessage::assignImpl ( const ToolsMessage other)
protectedpure virtual

Polymophic assignment functionality.

Invoked by assign().

◆ decodeData()

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

Decode (or deserialise) message contents.

Invokes decodeDataImpl().

◆ decodeDataImpl()

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

Polymorphic deserialisation functionality.

Invoked by decodeData().

◆ encodeData()

ToolsMessage::DataSeq cc_tools_qt::ToolsMessage::encodeData ( ) const

Encode (or serialise) message contents.

Invokes encodeDataImpl().

◆ encodeDataImpl()

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

Polymorphic serialisation functionality.

Invoked by encodeData().

◆ idAsString()

QString cc_tools_qt::ToolsMessage::idAsString ( ) const

Get string representation of message ID.

Invokes idAsStringImpl().

◆ idAsStringImpl()

QString cc_tools_qt::ToolsMessage::idAsStringImpl ( ) const
protectedvirtual

Polymophic functionality to get string representation of message ID.

Invoked by idAsString().

◆ isValid()

bool cc_tools_qt::ToolsMessage::isValid ( ) const

Check the message contents are valid.

Invokes isValidImpl().

◆ isValidImpl()

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

Polymorphic validity check functionality.

Invoked by isValid().

◆ name()

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

Get message name.

Invokes virtual nameImpl().

◆ nameImpl()

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

Polymorphic name retrieval functionality.

Invoked by name().

◆ numericIdImpl()

virtual qlonglong cc_tools_qt::ToolsMessage::numericIdImpl ( ) const
protectedpure virtual

Polymophic functionality to get numeric message ID.

Invoked by idAsString().

◆ refreshMsg()

bool cc_tools_qt::ToolsMessage::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::ToolsMessage::refreshMsgImpl ( )
protectedpure virtual

Polymorphic refresh functionality.

Invoked by refresh().

◆ resetImpl()

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

Polymorphic reset functionality.

Invoked by reset().


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