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

New strategy parameter values (ADR-0013): up to kMaxFields (field index, raw value) pairs, built and validated off the engine thread (strategies/param_publisher.hpp). More...

#include <fastmm/core/messages.hpp>

Public Types

enum class  Origin : std::uint8_t { Strategy = 0 , Control = 1 }
 

Public Member Functions

bool all_instruments () const noexcept
 
std::string_view source_view () const noexcept
 
void set_source (std::string_view s) noexcept
 Copies s into source, cut to kSourceLen - 1 bytes.
 

Public Attributes

EventHeader hdr
 
std::uint32_t count
 pairs used
 
Origin origin
 
std::uint8_t pad0_ [3]
 
std::uint64_t publish_seq
 the publisher's sequence number, from 1
 
std::uint16_t field [kMaxFields]
 schema index of each pair
 
char source [kSourceLen]
 who asked for it, e.g. "manual", "scheduled:drain"
 
std::uint8_t pad1_ [8]
 
std::int64_t value [kMaxFields]
 raw value of each pair
 

Static Public Attributes

static constexpr std::size_t kMaxFields = 32
 
static constexpr std::size_t kSourceLen = 40
 source, NUL-terminated
 
static constexpr InstrumentId kAllInstruments {}
 hdr.instrument of an update for every instrument: the invalid id.
 

Detailed Description

New strategy parameter values (ADR-0013): up to kMaxFields (field index, raw value) pairs, built and validated off the engine thread (strategies/param_publisher.hpp).

The engine applies them together at one event, journals the message and calls on_params. A field index is the position of the parameter in the strategy's schema; the journal header records the schema, so a replay resolves indices by name. A raw value is the field's int64 form (ParamDesc::get_raw): the value of an integer or bool, the raw fixed-point value of Price, Qty, Notional and Ratio, the nanoseconds of a Duration and the IEEE-754 bits of a double. origin names the publisher (the control socket's sequence is the one fastmm-ctl waits on) and source who asked for the change (fastmm-ctl param --source), both zero in journals written before they existed.

Member Enumeration Documentation

◆ Origin

enum class fastmm::ParamUpdateMsg::Origin : std::uint8_t
strong
Enumerator
Strategy 

the strategy's own publisher (a slow tier, a model), or not recorded

Control 

the control socket (fastmm-ctl param)

Member Function Documentation

◆ all_instruments()

bool fastmm::ParamUpdateMsg::all_instruments ( ) const
inlinenoexcept

◆ source_view()

std::string_view fastmm::ParamUpdateMsg::source_view ( ) const
inlinenoexcept

◆ set_source()

void fastmm::ParamUpdateMsg::set_source ( std::string_view  s)
inlinenoexcept

Copies s into source, cut to kSourceLen - 1 bytes.

Member Data Documentation

◆ kMaxFields

constexpr std::size_t fastmm::ParamUpdateMsg::kMaxFields = 32
staticconstexpr

◆ kSourceLen

constexpr std::size_t fastmm::ParamUpdateMsg::kSourceLen = 40
staticconstexpr

source, NUL-terminated

◆ kAllInstruments

constexpr InstrumentId fastmm::ParamUpdateMsg::kAllInstruments {}
staticconstexpr

hdr.instrument of an update for every instrument: the invalid id.

◆ hdr

EventHeader fastmm::ParamUpdateMsg::hdr

◆ count

std::uint32_t fastmm::ParamUpdateMsg::count

pairs used

◆ origin

Origin fastmm::ParamUpdateMsg::origin

◆ pad0_

std::uint8_t fastmm::ParamUpdateMsg::pad0_[3]

◆ publish_seq

std::uint64_t fastmm::ParamUpdateMsg::publish_seq

the publisher's sequence number, from 1

◆ field

std::uint16_t fastmm::ParamUpdateMsg::field[kMaxFields]

schema index of each pair

◆ source

char fastmm::ParamUpdateMsg::source[kSourceLen]

who asked for it, e.g. "manual", "scheduled:drain"

◆ pad1_

std::uint8_t fastmm::ParamUpdateMsg::pad1_[8]

◆ value

std::int64_t fastmm::ParamUpdateMsg::value[kMaxFields]

raw value of each pair