SingleChannelBinaryTraceFileReader

class SingleChannelBinaryTraceFileReader : public osi3::TraceFileReader

Implementation of TraceFileReader for binary format files containing OSI messages.

This class provides functionality to read OSI messages in the single binary channel format.

Note

Thread Safety: Instances are not thread-safe.

Public Functions

~SingleChannelBinaryTraceFileReader() override

Destructor, closes the file if still open.

virtual bool Open(const std::filesystem::path &file_path) override

Opens a trace file for reading and infers message type from filename.

Parameters:

file_path – Path to the trace file

Returns:

true if successful, false otherwise

bool Open(const std::filesystem::path &file_path, ReaderTopLevelMessage message_type)

Opens a trace file with specified message type.

Parameters:
  • file_path – Path to the trace file

  • message_type – Expected message type in the file

Returns:

true if successful, false otherwise

virtual std::optional<ReadResult> ReadMessage() override

Reads the next message from the trace file.

Returns:

Optional ReadResult containing the message if available

virtual void Close() override

Closes the trace file.

virtual bool HasNext() override

Checks whether more messages are available.

Returns:

true if there are more messages to read, false otherwise

inline ReaderTopLevelMessage GetMessageType() const

Gets the current message type being read.

Returns:

The message type enum value