ROS2Sonic  0.2.0
A ROS2 driver for R2Sonic MBES
Loading...
Searching...
No Matches
r2sonic::sections::Section Class Referenceabstract

a common base class for all r2 sonic message section definitions More...

#include <section.hpp>

Inheritance diagram for r2sonic::sections::Section:

Public Member Functions

 Section (char *start_bit)
 Section.
 
virtual char * nominalType () const =0
 returns a chararacter array of length 2 saying the nominal type of the section class
 
bool isType () const
 Return true if your type matches the header.
 
bool exists () const
 states weather that section exists where expected
 
u16 getSize () const
 getSize returns the size of the message in system-endian order
 
SectionInfoinfo () const
 info gets the reference to the common section info
 
char * end () const
 end returns a pointer to one bit beyond the current section (the first bit of the next seciton)
 

Protected Member Functions

void existanceErrorCheck () const
 

Protected Attributes

char * start_bit_
 a pointer to the first bit in the message
 

Detailed Description

a common base class for all r2 sonic message section definitions

Note
accessors with a get* prefix will return a machine-endian value accessors without the get prefix will return a reference to the raw data which will be in big-endian order as per the r2sonic spec

Constructor & Destructor Documentation

◆ Section()

r2sonic::sections::Section::Section ( char * start_bit)
inline

Section.

Parameters
start_bit

Member Function Documentation

◆ end()

char * r2sonic::sections::Section::end ( ) const
inline

end returns a pointer to one bit beyond the current section (the first bit of the next seciton)

Returns
the pointer to the next section

◆ existanceErrorCheck()

void r2sonic::sections::Section::existanceErrorCheck ( ) const
inlineprotected

◆ exists()

bool r2sonic::sections::Section::exists ( ) const
inline

states weather that section exists where expected

Returns
true if the requested section exists

◆ getSize()

u16 r2sonic::sections::Section::getSize ( ) const
inline

getSize returns the size of the message in system-endian order

Note
this function will return 0 if your type doesn't match SectionInfo.name
Returns
the size of the section in system endian order. Returns 0 if your type doesn't match indicating a seciton doesn't exist.

◆ info()

SectionInfo * r2sonic::sections::Section::info ( ) const
inline

info gets the reference to the common section info

Returns
a reference to the common section info

◆ isType()

bool r2sonic::sections::Section::isType ( ) const
inline

Return true if your type matches the header.

Returns
true if your type matches the header

◆ nominalType()

virtual char * r2sonic::sections::Section::nominalType ( ) const
pure virtual

Member Data Documentation

◆ start_bit_

char* r2sonic::sections::Section::start_bit_
protected

a pointer to the first bit in the message


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