roo_monitoring
API Documentation for roo_monitoring
Loading...
Searching...
No Matches
roo_monitoring::LogFileReader Class Reference

Reader for a single log file. More...

#include <log.h>

Public Member Functions

 LogFileReader (roo_io::Mount &mount)
 Creates a reader over the specified mount.
 
bool open (const char *path, int64_t checkpoint)
 Opens the log file at path and seeks to checkpoint.
 
bool is_open () const
 Returns true if a file is currently open.
 
void close ()
 Closes the reader.
 
int64_t checkpoint () const
 Returns the current checkpoint position.
 
bool next (int64_t *timestamp, std::vector< LogSample > *data, bool is_hot)
 Reads the next entry from the file.
 

Detailed Description

Reader for a single log file.

Definition at line 67 of file log.h.

Constructor & Destructor Documentation

◆ LogFileReader()

roo_monitoring::LogFileReader::LogFileReader ( roo_io::Mount &  mount)
inline

Creates a reader over the specified mount.

Definition at line 70 of file log.h.

Member Function Documentation

◆ checkpoint()

int64_t roo_monitoring::LogFileReader::checkpoint ( ) const
inline

Returns the current checkpoint position.

Definition at line 82 of file log.h.

Referenced by open(), and roo_monitoring::LogReader::tell().

◆ close()

void roo_monitoring::LogFileReader::close ( )
inline

Closes the reader.

Definition at line 79 of file log.h.

Referenced by roo_monitoring::LogReader::nextSample().

◆ is_open()

bool roo_monitoring::LogFileReader::is_open ( ) const
inline

Returns true if a file is currently open.

Definition at line 76 of file log.h.

Referenced by roo_monitoring::LogReader::nextSample().

◆ next()

bool roo_monitoring::LogFileReader::next ( int64_t *  timestamp,
std::vector< LogSample > *  data,
bool  is_hot 
)

Reads the next entry from the file.

Definition at line 45 of file log.cpp.

References roo_monitoring::CODE_DATUM, and roo_monitoring::CODE_TIMESTAMP.

Referenced by roo_monitoring::LogReader::nextSample().

◆ open()

bool roo_monitoring::LogFileReader::open ( const char *  path,
int64_t  checkpoint 
)

Opens the log file at path and seeks to checkpoint.

Definition at line 23 of file log.cpp.

References checkpoint().

Referenced by roo_monitoring::LogReader::seek().


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