waterlinkedsonar
C++ client library for the Water Linked Sonar 3D-15
Loading...
Searching...
No Matches
Public Member Functions | List of all members
waterlinked::sonar::rip::Decoder Class Reference

Range Image Protocol codec (https://docs.waterlinked.com/sonar-3d/sonar-3d-15-api/). More...

#include <waterlinkedsonar/rip.hpp>

Public Member Functions

 Decoder ()
 
 ~Decoder ()
 
 Decoder (Decoder &&) noexcept
 
Decoderoperator= (Decoder &&) noexcept
 
 Decoder (const Decoder &)=delete
 
Decoderoperator= (const Decoder &)=delete
 
Decoded decode (const std::uint8_t *data, std::size_t size)
 Decodes one datagram.
 

Detailed Description

Range Image Protocol codec (https://docs.waterlinked.com/sonar-3d/sonar-3d-15-api/).

A packet is [4B magic "RIP2"|"RIP1"][4B LE total length][payload] [4B LE CRC-32], where the CRC covers everything before it and the RIP2 payload is a snappy-compressed serialized protobuf (RIP1 is uncompressed).

The decoder reuses internal buffers across calls, so decoding is steady-state allocation-free and the returned views point into those buffers: a view is valid until the next decode() on the same Decoder, like an iterator invalidated by container mutation. Copy any data kept longer. Not thread-safe; one caller at a time.

Constructor & Destructor Documentation

◆ Decoder() [1/3]

waterlinked::sonar::rip::Decoder::Decoder ( )

◆ ~Decoder()

waterlinked::sonar::rip::Decoder::~Decoder ( )

◆ Decoder() [2/3]

waterlinked::sonar::rip::Decoder::Decoder ( Decoder &&  )
noexcept

◆ Decoder() [3/3]

waterlinked::sonar::rip::Decoder::Decoder ( const Decoder )
delete

Member Function Documentation

◆ decode()

Decoded waterlinked::sonar::rip::Decoder::decode ( const std::uint8_t *  data,
std::size_t  size 
)

Decodes one datagram.

Never throws; malformed input is reported through the returned status.

Parameters
dataDatagram bytes.
sizeDatagram size; the packet's length field must equal it.
Returns
Status plus, on OK, a view of the decoded message. Invalidates views returned by previous calls.

◆ operator=() [1/2]

Decoder & waterlinked::sonar::rip::Decoder::operator= ( const Decoder )
delete

◆ operator=() [2/2]

Decoder & waterlinked::sonar::rip::Decoder::operator= ( Decoder &&  )
noexcept

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