farm-ng-core
farm_ng::EventLogReader Class Reference

Reader to deserialize data written by the EventLogWriter. More...

#include <event_log_reader.h>

Public Member Functions

 EventLogReader (std::filesystem::path const &log_path)
 Open's log file to read. More...
 
virtual ~EventLogReader ()
 https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rh-dtor More...
 
EventLogPos readNextEvent (std::string *payload=nullptr)
 
std::vector< EventLogPos > const & getIndex ()
 
std::filesystem::path getPath () const
 Returns the path including the fileaname. More...
 
void reset ()
 Reset the writer to the beginning of the file. More...
 

Detailed Description

Reader to deserialize data written by the EventLogWriter.

Constructor & Destructor Documentation

◆ EventLogReader()

farm_ng::EventLogReader::EventLogReader ( std::filesystem::path const &  log_path)
explicit

Open's log file to read.

Throws runtime-error if files could not be opened or if logfile does not contain a valid header.

◆ ~EventLogReader()

farm_ng::EventLogReader::~EventLogReader ( )
virtual

Member Function Documentation

◆ getIndex()

auto farm_ng::EventLogReader::getIndex ( )

◆ getPath()

auto farm_ng::EventLogReader::getPath ( ) const

Returns the path including the fileaname.

◆ readNextEvent()

auto farm_ng::EventLogReader::readNextEvent ( std::string *  payload = nullptr)

◆ reset()

void farm_ng::EventLogReader::reset ( )

Reset the writer to the beginning of the file.


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