livox_mid360_core
C++ driver library for the Livox Mid-360 LiDAR
Loading...
Searching...
No Matches
livox::mid360::Lvx2Reader Class Reference

Reads an lvx2 file package by package. More...

#include <livox/mid360/lvx2.hpp>

Public Member Functions

 Lvx2Reader (const Lvx2Reader &)=delete
Lvx2Reader & operator= (const Lvx2Reader &)=delete
 Lvx2Reader (Lvx2Reader &&) noexcept
 Takes over the other reader's file; the moved-from reader must not be used again.
Lvx2Reader & operator= (Lvx2Reader &&) noexcept
 Takes over the other reader's file; the moved-from reader must not be used again.
std::expected< void, Lvx2Error > open (const std::filesystem::path &path)
 Opens path and reads the headers and the device-info block, so header() and devices() are valid afterwards.
const Lvx2FileHeader & header () const noexcept
 File header of the open file.
const std::vector< Lvx2DeviceInfo > & devices () const noexcept
 Device-info block of the open file.
std::expected< std::optional< Lvx2Packet >, Lvx2Error > next_packet ()
 Next package in file order; nullopt at the end (or at a truncated tail).
bool truncated () const noexcept
 True once the reader has hit the cut-off tail of a truncated file.

Detailed Description

Reads an lvx2 file package by package.

A file whose tail is cut mid-frame yields the packages that are complete and then sets truncated().

Member Function Documentation

◆ open()

std::expected< void, Lvx2Error > livox::mid360::Lvx2Reader::open ( const std::filesystem::path & path)
nodiscard

Opens path and reads the headers and the device-info block, so header() and devices() are valid afterwards.

Reopening starts again at the first package.

◆ next_packet()

std::expected< std::optional< Lvx2Packet >, Lvx2Error > livox::mid360::Lvx2Reader::next_packet ( )
nodiscard

Next package in file order; nullopt at the end (or at a truncated tail).

kBadFile / kUnsupportedDataType stop the iteration.


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