FastMM documentation
FastMM C++ API 0.14.0
Public headers, tier 1 and tier 2
Loading...
Searching...
No Matches
fastmm::StrategyBase< Params, Scope > Class Template Reference

#include <fastmm/strategies/strategy.hpp>

Public Types

using params_type = Params
 

Public Member Functions

std::optional< std::string > configure (const ParamMap &m)
 Applies string parameters, then runs validate() const when the params struct declares one.
 
const Params & params () const noexcept
 Read-only: parameters change through configure() and apply_param_update().
 
const Params & params (InstrumentId id) const noexcept
 Instrument id's parameters: params() with the instrument's own values on top.
 
ParamMask own_params (InstrumentId id) const noexcept
 The parameters instrument id holds a value of its own for, by schema index; none with Shared.
 
void apply_param_update (const ParamUpdateMsg &m) noexcept
 Engine thread: assigns the (field, raw value) pairs of a ParamUpdateMsg, which the publisher validated (strategies/param_publisher.hpp): to the shared set, or with PerInstrument to the sets apply_param_pairs() names.
 
std::string describe_params () const
 

Static Public Member Functions

static const ParamSchema & schema ()
 

Static Public Attributes

static constexpr ParamScope param_scope = Scope
 

Member Typedef Documentation

◆ params_type

template<class Params , ParamScope Scope = ParamScope::Shared>
using fastmm::StrategyBase< Params, Scope >::params_type = Params

Member Function Documentation

◆ schema()

template<class Params , ParamScope Scope = ParamScope::Shared>
static const ParamSchema & fastmm::StrategyBase< Params, Scope >::schema ( )
inlinestatic

◆ configure()

template<class Params , ParamScope Scope = ParamScope::Shared>
std::optional< std::string > fastmm::StrategyBase< Params, Scope >::configure ( const ParamMap &  m)
inline

Applies string parameters, then runs validate() const when the params struct declares one.

Returns the first error message; the parameters are unchanged then (startup only).

◆ params() [1/2]

template<class Params , ParamScope Scope = ParamScope::Shared>
const Params & fastmm::StrategyBase< Params, Scope >::params ( ) const
inlinenoexcept

Read-only: parameters change through configure() and apply_param_update().

The set every instrument starts from: the configured values and the updates that named no instrument.

◆ params() [2/2]

template<class Params , ParamScope Scope = ParamScope::Shared>
const Params & fastmm::StrategyBase< Params, Scope >::params ( InstrumentId  id) const
inlinenoexcept

Instrument id's parameters: params() with the instrument's own values on top.

A Shared strategy has one set, so this is params(). O(1).

◆ own_params()

template<class Params , ParamScope Scope = ParamScope::Shared>
ParamMask fastmm::StrategyBase< Params, Scope >::own_params ( InstrumentId  id) const
inlinenoexcept

The parameters instrument id holds a value of its own for, by schema index; none with Shared.

◆ apply_param_update()

template<class Params , ParamScope Scope = ParamScope::Shared>
void fastmm::StrategyBase< Params, Scope >::apply_param_update ( const ParamUpdateMsg &  m)
inlinenoexcept

Engine thread: assigns the (field, raw value) pairs of a ParamUpdateMsg, which the publisher validated (strategies/param_publisher.hpp): to the shared set, or with PerInstrument to the sets apply_param_pairs() names.

A field outside the schema is skipped.

◆ describe_params()

template<class Params , ParamScope Scope = ParamScope::Shared>
std::string fastmm::StrategyBase< Params, Scope >::describe_params ( ) const
inline

Member Data Documentation

◆ param_scope

template<class Params , ParamScope Scope = ParamScope::Shared>
constexpr ParamScope fastmm::StrategyBase< Params, Scope >::param_scope = Scope
staticconstexpr