Main MRPT website > C++ reference for MRPT 1.9.9
List of all members | Public Member Functions
IProtocolHandler Class Referenceabstract

Detailed Description

Interface class for protocol handlers.

Describes the interfaces of the protocol handling classes. The protocol handlers are used to convert a binary data stream into XsMessage objects.

Definition at line 22 of file iprotocolhandler.h.

#include <xSens_MT4/xcommunication/include/xsens/iprotocolhandler.h>

Inheritance diagram for IProtocolHandler:
Inheritance graph

Public Member Functions

virtual ~IProtocolHandler ()
 Destructor. More...
 
virtual MessageLocation findMessage (XsMessage &rcv, const XsByteArray &raw) const =0
 Find the first message in the raw byte stream. More...
 
virtual int minimumMessageSize () const =0
 Returns the minimum size of a valid message. More...
 
virtual int maximumMessageSize () const =0
 Returns the maximum size of a valid message. More...
 
virtual int type () const =0
 Returns the type of the protocol handler. More...
 

Constructor & Destructor Documentation

◆ ~IProtocolHandler()

virtual IProtocolHandler::~IProtocolHandler ( )
inlinevirtual

Destructor.

Definition at line 26 of file iprotocolhandler.h.

Member Function Documentation

◆ findMessage()

virtual MessageLocation IProtocolHandler::findMessage ( XsMessage rcv,
const XsByteArray raw 
) const
pure virtual

Find the first message in the raw byte stream.

This function scans raw for a sequence of bytes that it can convert into an XsMessage object. It returns the location and total byte size of the message so that the caller can remove those bytes from the stream. The return value can also describe that a partial message has been found. Return values:

  • startpos >= 0 and size > 0: A full message with size has been found at startpos.
  • startpos >= 0 and size == 0: The start of a message has been found at startpos, but the size could not yet be determined.
  • startpos >= 0 and size < 0: The start of a message has been found at startpos, and the size of the full message is at least -size.
  • startpos < 0: No messages have been found.
Parameters
rcvIf a message is read, it will be put in this object.
rawThe raw byte stream to analyze.
Returns
A MessageLocation object that describes what was found.

Implemented in ProtocolHandler.

◆ maximumMessageSize()

virtual int IProtocolHandler::maximumMessageSize ( ) const
pure virtual

Returns the maximum size of a valid message.

This value may differ for different protocols.

Returns
The maximum size of a valid message for the protocol.

Implemented in ProtocolHandler.

◆ minimumMessageSize()

virtual int IProtocolHandler::minimumMessageSize ( ) const
pure virtual

Returns the minimum size of a valid message.

This value may differ for different protocols, but is always at least 1.

Returns
The minimum size of a valid message for the protocol.

Implemented in ProtocolHandler.

◆ type()

virtual int IProtocolHandler::type ( ) const
pure virtual

Returns the type of the protocol handler.

Each protocol handler has a locally unique id that can be used for instantiation of the correct protocol handler.

Returns
The type id of the protocol handler.

Implemented in ProtocolHandler.




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at lun oct 28 00:14:14 CET 2019