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

A journal held in memory, lost when the process exits; for tests and dry runs. More...

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

Public Member Functions

 MemoryJournal ()=default
 Constructs a journal with an empty scope.
 MemoryJournal (std::string scope)
 Constructs a journal.
bool append (const JournalEntry &entry)
 Appends a line.
JournalReplay replay () const
 Returns everything recorded.
const std::vector< JournalEntry > & records () const noexcept
 Returns the lines recorded.
void clear () noexcept
 Forgets every line.
const std::string & scope () const noexcept
 Returns the journal's broker and account.

Detailed Description

A journal held in memory, lost when the process exits; for tests and dry runs.

Definition at line 623 of file journal.hpp.

Constructor & Destructor Documentation

◆ MemoryJournal()

algotradelib::runner::MemoryJournal::MemoryJournal ( std::string scope)
inlineexplicit

Constructs a journal.

Parameters
scopeThe broker and account stamped on each line that has none.

Definition at line 632 of file journal.hpp.

Member Function Documentation

◆ append()

bool algotradelib::runner::MemoryJournal::append ( const JournalEntry & entry)
inline

Appends a line.

Parameters
entryThe line.
Returns
true.

Definition at line 639 of file journal.hpp.

◆ clear()

void algotradelib::runner::MemoryJournal::clear ( )
inlinenoexcept

Forgets every line.

Definition at line 664 of file journal.hpp.

◆ records()

const std::vector< JournalEntry > & algotradelib::runner::MemoryJournal::records ( ) const
inlinenoexcept

Returns the lines recorded.

Returns
The lines, in order.

Definition at line 661 of file journal.hpp.

◆ replay()

JournalReplay algotradelib::runner::MemoryJournal::replay ( ) const
inline

Returns everything recorded.

Returns
The lines, with no damage.

Definition at line 651 of file journal.hpp.

Referenced by replay().

◆ scope()

const std::string & algotradelib::runner::MemoryJournal::scope ( ) const
inlinenoexcept

Returns the journal's broker and account.

Returns
The scope.

Definition at line 670 of file journal.hpp.

Referenced by MemoryJournal().


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