|
FastMM C++ API 0.14.0
Public headers, tier 1 and tier 2
|
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 , Experiment = 2 , Config = 3 } |
Public Member Functions | |
| bool | all_instruments () const noexcept |
| bool | resets () const noexcept |
| The update drops the instruments' own values of the parameters it names (kReset). | |
| 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 | arm |
| kArmKeep, kArmNone or arm + 1 | |
| std::uint8_t | flags |
| kReset | |
| std::uint8_t | pad0_ [1] |
| 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 std::uint8_t | kArmKeep = 0 |
| static constexpr std::uint8_t | kArmNone = 0xFF |
| static constexpr InstrumentId | kAllInstruments {} |
| hdr.instrument of an update for every instrument: the invalid id. | |
| static constexpr std::uint8_t | kReset = 1U << 0 |
flags. | |
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. arm moves the update's instruments into an arm of the [ab] test (strategies/ab_test.hpp): kArmKeep leaves them where they are, kArmNone takes them out of the test, k + 1 puts them in arm k.
|
strong |
|
inlinenoexcept |
|
inlinenoexcept |
The update drops the instruments' own values of the parameters it names (kReset).
|
inlinenoexcept |
|
inlinenoexcept |
Copies s into source, cut to kSourceLen - 1 bytes.
|
staticconstexpr |
|
staticconstexpr |
source, NUL-terminated
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
hdr.instrument of an update for every instrument: the invalid id.
|
staticconstexpr |
flags.
kReset: the named parameters stop being the instrument's own and take the shared value again, which value carries; for every instrument, each instrument's own value of them is dropped. An update for every instrument with an arm is a reset as well.
| EventHeader fastmm::ParamUpdateMsg::hdr |
| std::uint32_t fastmm::ParamUpdateMsg::count |
pairs used
| Origin fastmm::ParamUpdateMsg::origin |
| std::uint8_t fastmm::ParamUpdateMsg::arm |
kArmKeep, kArmNone or arm + 1
| std::uint8_t fastmm::ParamUpdateMsg::flags |
kReset
| std::uint8_t fastmm::ParamUpdateMsg::pad0_[1] |
| std::uint64_t fastmm::ParamUpdateMsg::publish_seq |
the publisher's sequence number, from 1
| std::uint16_t fastmm::ParamUpdateMsg::field[kMaxFields] |
schema index of each pair
| char fastmm::ParamUpdateMsg::source[kSourceLen] |
who asked for it, e.g. "manual", "scheduled:drain"
| std::uint8_t fastmm::ParamUpdateMsg::pad1_[8] |
| std::int64_t fastmm::ParamUpdateMsg::value[kMaxFields] |
raw value of each pair