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

A strategy the caller builds instead of the registry's [strategy] name. More...

#include <fastmm/live/session.hpp>

Public Attributes

std::string name
 journal header, status file and log lines
 
const ParamSchema * params = nullptr
 the journal's parameter table
 
std::string meta
 the journal's strategy metadata (key=value lines)
 
std::vector< MsgRing * > inputs
 Rings the engine polls besides the venues' (parameter updates); the caller keeps them alive.
 
std::function< void(std::function< void()> wake)> set_waker
 Called with a function that wakes the engine, before the session's threads start, and with an empty one before the session returns.
 
std::function< std::unique_ptr< IEngineRunner >(RunnerDeps &deps)> make
 Builds the runner on deps (deps.backend is a LiveBackend) on the calling thread, after the venues' reference data has loaded and before any session thread starts.
 
std::function< void(IEngineRunner &runner)> finished
 Called after the engine thread has stopped, before the runner is destroyed.
 
std::function< std::string(const std::vector< std::pair< std::string, std::string > > &, InstrumentId)> set_params
 The control socket's param: validates the (name, value) pairs against this strategy's schema and publishes them onto one of inputs (the caller owns the publisher, so its copy of the parameters stays the only one).
 

Detailed Description

A strategy the caller builds instead of the registry's [strategy] name.

Member Data Documentation

◆ name

std::string fastmm::live::LiveStrategy::name

journal header, status file and log lines

◆ params

const ParamSchema* fastmm::live::LiveStrategy::params = nullptr

the journal's parameter table

◆ meta

std::string fastmm::live::LiveStrategy::meta

the journal's strategy metadata (key=value lines)

◆ inputs

std::vector<MsgRing*> fastmm::live::LiveStrategy::inputs

Rings the engine polls besides the venues' (parameter updates); the caller keeps them alive.

◆ set_waker

std::function<void(std::function<void()> wake)> fastmm::live::LiveStrategy::set_waker

Called with a function that wakes the engine, before the session's threads start, and with an empty one before the session returns.

With spin_mode = "adaptive" an idle engine blocks; a producer on inputs calls the function after each push, or its message waits up to 1 ms.

◆ make

std::function<std::unique_ptr<IEngineRunner>(RunnerDeps& deps)> fastmm::live::LiveStrategy::make

Builds the runner on deps (deps.backend is a LiveBackend) on the calling thread, after the venues' reference data has loaded and before any session thread starts.

An exception or nullptr gives kExitConfig.

◆ finished

std::function<void(IEngineRunner& runner)> fastmm::live::LiveStrategy::finished

Called after the engine thread has stopped, before the runner is destroyed.

◆ set_params

std::function<std::string(const std::vector<std::pair<std::string, std::string>>&, InstrumentId)> fastmm::live::LiveStrategy::set_params

The control socket's param: validates the (name, value) pairs against this strategy's schema and publishes them onto one of inputs (the caller owns the publisher, so its copy of the parameters stays the only one).

Returns the error message, empty on success. Unset: the session answers param with an error.