algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
Loading...
Searching...
No Matches
algotradelib::runner::JournalReplay Struct Reference

The contents of a journal, including what could not be read. More...

#include <algotradelib/src/runner/journal.hpp>

Public Member Functions

bool readable () const noexcept
 Tests whether the file could be read.
bool intact () const noexcept
 Tests whether everything was read.

Public Attributes

std::vector< JournalEntry > entries_
 Every line that parsed, in file order.
std::size_t unreadable_lines_ {0}
 How many lines did not parse (on an append-only file, writes that did not finish).
bool truncated_tail_ {false}
 Whether the last line was incomplete, as after a kill during a write.
std::string detail_
 What was wrong, for the operator.
std::string scope_
 The broker and account the file's header declares, if it has one.
bool has_header_ {false}
 Whether a header was found; a non-empty file without one is not written to.
JournalReadStatus status_ {JournalReadStatus::READ}
 Whether the file was read; READ for an in-memory journal.

Detailed Description

The contents of a journal, including what could not be read.

Damage is returned as data: a torn last line is evidence that something was in flight.

Definition at line 464 of file journal.hpp.

Member Function Documentation

◆ intact()

bool algotradelib::runner::JournalReplay::intact ( ) const
inlinenoexcept

Tests whether everything was read.

Returns
true if readable, with no unparsed lines and no torn last line.

Definition at line 499 of file journal.hpp.

◆ readable()

bool algotradelib::runner::JournalReplay::readable ( ) const
inlinenoexcept

Tests whether the file could be read.

Returns
false only for UNREADABLE.

Definition at line 484 of file journal.hpp.

Referenced by intact(), and algotradelib::runner::recover_into().

Member Data Documentation

◆ detail_

std::string algotradelib::runner::JournalReplay::detail_

What was wrong, for the operator.

Definition at line 472 of file journal.hpp.

Referenced by algotradelib::runner::parse_journal_bytes(), and algotradelib::runner::recover_into().

◆ entries_

◆ has_header_

bool algotradelib::runner::JournalReplay::has_header_ {false}

Whether a header was found; a non-empty file without one is not written to.

Definition at line 476 of file journal.hpp.

Referenced by algotradelib::runner::parse_journal_bytes().

◆ scope_

std::string algotradelib::runner::JournalReplay::scope_

The broker and account the file's header declares, if it has one.

Definition at line 474 of file journal.hpp.

Referenced by algotradelib::runner::parse_journal_bytes().

◆ status_

JournalReadStatus algotradelib::runner::JournalReplay::status_ {JournalReadStatus::READ}

Whether the file was read; READ for an in-memory journal.

Definition at line 478 of file journal.hpp.

Referenced by algotradelib::runner::parse_journal_bytes(), and readable().

◆ truncated_tail_

bool algotradelib::runner::JournalReplay::truncated_tail_ {false}

Whether the last line was incomplete, as after a kill during a write.

Definition at line 470 of file journal.hpp.

Referenced by intact(), algotradelib::runner::parse_journal_bytes(), and algotradelib::runner::recover_into().

◆ unreadable_lines_

std::size_t algotradelib::runner::JournalReplay::unreadable_lines_ {0}

How many lines did not parse (on an append-only file, writes that did not finish).

Definition at line 468 of file journal.hpp.

Referenced by intact(), algotradelib::runner::parse_journal_bytes(), and algotradelib::runner::recover_into().


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