FastMM documentation
FastMM C++ API 0.6.0
Public headers, tier 1 and tier 2
Loading...
Searching...
No Matches
fastmm::bt::MergedSource Class Referencefinal

k-way merge of several sources by event time (stable: lower source index first on ties). More...

#include <fastmm/backtest/data_source.hpp>

Inheritance diagram for fastmm::bt::MergedSource:

Public Member Functions

 MergedSource (std::vector< MdSource * > sources)
 
const EventHeader * next () override
 
void reset () override
 
Timestamp start_ts () const override
 Earliest start among the inputs (invalid if none reports one).
 

Static Public Member Functions

static Timestamp time_of (const EventHeader &h) noexcept
 

Detailed Description

k-way merge of several sources by event time (stable: lower source index first on ties).

The event yielded is the input's own, not a copy: a journal's record can be larger than an EventBuf (a depth snapshot of up to kMaxBookLevelsPerMsg a side), so the input it came from is advanced on the next call, when the pointer may lapse, not before.

Constructor & Destructor Documentation

◆ MergedSource()

fastmm::bt::MergedSource::MergedSource ( std::vector< MdSource * >  sources)
inlineexplicit

Member Function Documentation

◆ next()

const EventHeader * fastmm::bt::MergedSource::next ( )
inlineoverride

◆ reset()

void fastmm::bt::MergedSource::reset ( )
inlineoverride

◆ start_ts()

Timestamp fastmm::bt::MergedSource::start_ts ( ) const
inlineoverride

Earliest start among the inputs (invalid if none reports one).

◆ time_of()

static Timestamp fastmm::bt::MergedSource::time_of ( const EventHeader &  h)
inlinestaticnoexcept