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

Engine-side producer. More...

#include <fastmm/core/record_stream.hpp>

Public Member Functions

 RecordWriter (MsgRing *ring=nullptr, std::uint64_t session_id=0) noexcept
 
bool enabled () const noexcept
 
std::uint64_t written () const noexcept
 
std::uint64_t dropped () const noexcept
 
FASTMM_FORCE_INLINE bool put (const RecordHeader &r) noexcept
 
template<class R >
FASTMM_FORCE_INLINE void init (R &r, RecordType type, InstrumentId inst, VenueId venue, Timestamp engine_ts, Timestamp wall_ts) noexcept
 Fills in the parts every record shares.
 

Detailed Description

Engine-side producer.

Every method is allocation-free, wait-free and safe to call from the trading thread; a full ring increments dropped() and returns false.

Constructor & Destructor Documentation

◆ RecordWriter()

fastmm::RecordWriter::RecordWriter ( MsgRing *  ring = nullptr,
std::uint64_t  session_id = 0 
)
inlineexplicitnoexcept

Member Function Documentation

◆ enabled()

bool fastmm::RecordWriter::enabled ( ) const
inlinenoexcept

◆ written()

std::uint64_t fastmm::RecordWriter::written ( ) const
inlinenoexcept

◆ dropped()

std::uint64_t fastmm::RecordWriter::dropped ( ) const
inlinenoexcept

◆ put()

FASTMM_FORCE_INLINE bool fastmm::RecordWriter::put ( const RecordHeader &  r)
inlinenoexcept

< disabled: callers guard with enabled()

◆ init()

template<class R >
FASTMM_FORCE_INLINE void fastmm::RecordWriter::init ( R &  r,
RecordType  type,
InstrumentId  inst,
VenueId  venue,
Timestamp  engine_ts,
Timestamp  wall_ts 
)
inlinenoexcept

Fills in the parts every record shares.

The caller sets the record-specific fields and calls put(). len is sizeof the record.