/workspaces/astro/sol3-sdk/cpp/sol3/core/size_delimited_log_reader.h Source File
|
Space-ng SDK
|
size_delimited_log_reader.h
Go to the documentation of this file.
Definition: size_delimited_log_reader.h:65
size_t offsetBytes() const
Byte offset of the frame within the file.
Definition: size_delimited_log_reader.h:80
flatbuffers::span< uint8_t const > spanNoPrefix() const
flatbuffers::span< uint8_t const > span() const
Definition: size_delimited_log_reader.h:73
Definition: size_delimited_log_reader.h:100
Iterator(tl::expected< FrameView, ReadError > current)
Iterator(Iterator &&)=default
~Iterator()=default
bool operator==(Iterator const &other) const
FrameView const & reference
Definition: size_delimited_log_reader.h:103
reference operator*() const
Access the current frame; throws ReadErrorException if in error state.
Iterator & operator++()
tl::expected< FrameView, ReadError > const & frameView() const
Access the current frame or the read error, if any.
Iterator & operator=(Iterator const &other)=default
Iterator & operator=(Iterator &&other)=default
pointer operator->() const
Access the current frame; throws ReadErrorException if in error state.
FrameView const * pointer
Definition: size_delimited_log_reader.h:104
bool operator!=(Iterator const &other) const
Iterator(Iterator const &)=default
Exception wrapper that exposes the ReadError and context string.
Definition: size_delimited_log_reader.h:51
ReadErrorException(ReadError err, std::string_view context)
Builds a formatted error message for the provided ReadError.
std::string context
Definition: size_delimited_log_reader.h:57
ReadError error
Definition: size_delimited_log_reader.h:56
Definition: size_delimited_log_reader.h:23
SizeDelimitedLogReader & operator=(SizeDelimitedLogReader const &)=delete
SizeDelimitedLogReader(SizeDelimitedLogReader const &)=delete
SizeDelimitedLogReader & operator=(SizeDelimitedLogReader &&)=delete
tl::expected< FrameView, ReadError > readAtOffset(size_t offset) const
Iterator const & end() const
Sentinel iterator representing end-of-file.
SizeDelimitedLogReader(SizeDelimitedLogReader &&)=delete
static std::shared_ptr< SizeDelimitedLogReader > open(cpp::fs::path const &log_path)
cpp::fs::path const & logPath() const
Path for the currently opened log file.
Definition: size_delimited_log_reader.h:160
Iterator begin() const
Definition: shmem_buffer_impl.h:13
Definition: shmem_buffer_impl.h:36
Definition: any_message_input.h:15
std::string formatReadError(SizeDelimitedLogReader::ReadError const &err, std::string_view context)
Format a ReadError for logs or exceptions.
char const * readErrorCodeToString(SizeDelimitedLogReader::ReadError::Code code)
String conversion for error codes (stable, human-readable strings).
Read error details returned from readAtOffset() and iteration.
Definition: size_delimited_log_reader.h:26
@ kZeroSizeFrame
Size prefix declares a zero-length payload.
@ kNotOpen
File is not open or has been reset.
@ kTruncatedPrefix
Size prefix is truncated (not enough bytes for uint32_t).
@ kTruncatedBuffer
Payload or padding extends past the mapped file size.
@ kEndOfFile
Requested offset is at or past the logical end of file.
size_t offset
Byte offset used for the read attempt.
Definition: size_delimited_log_reader.h:43
size_t size
Total mapped file size at the time of the read.
Definition: size_delimited_log_reader.h:45
std::string path
Log file path associated with the read, when available.
Definition: size_delimited_log_reader.h:47
Code code
Error code describing the failure mode.
Definition: size_delimited_log_reader.h:41
Generated by