|
FastMM C++ API 0.14.0
Public headers, tier 1 and tier 2
|
#include <fastmm/strategies/param_publisher.hpp>
Classes | |
| struct | BlockOps |
| Copying and freeing a parameter block whose layout is known only at run time (strategies/hot_params.hpp); validate runs after the schema's parsers. More... | |
| struct | Value |
| Every parameter of the copy, in schema order: one instrument's, or the shared set. More... | |
Public Types | |
| using | ParamValue = std::pair< std::string, std::string > |
| name, value as ParamDesc::parse takes | |
Public Member Functions | |
| template<class Params > | |
| ParamPublisher (ParamSink sink, const Params ¤t, std::size_t instruments=0) | |
| ParamPublisher (ParamSink sink, const ParamSchema &schema, const BlockOps &ops, const void *current, std::size_t instruments=0) | |
schema's parsers and ops work on blocks like current; schema must outlive the publisher. | |
| ParamPublisher (const ParamPublisher &)=delete | |
| ParamPublisher & | operator= (const ParamPublisher &)=delete |
| ParamPublisher (ParamPublisher &&)=delete | |
| ParamPublisher & | operator= (ParamPublisher &&)=delete |
| ~ParamPublisher ()=default | |
| bool | publish (const std::vector< ParamValue > &values, InstrumentId inst=kAllInstruments) |
| Validates and sends one update. | |
| std::uint64_t | publish_as (const std::vector< ParamValue > &values, InstrumentId inst, ParamUpdateMsg::Origin origin, std::string_view source, std::uint8_t arm=ParamUpdateMsg::kArmKeep, std::uint8_t flags=0) |
| publish() with the update's origin, source (ParamUpdateMsg::source, cut to 39 bytes), [ab] arm (ParamUpdateMsg::arm) and flags. | |
| std::uint64_t | reset (const std::vector< std::string > &names, InstrumentId inst, ParamUpdateMsg::Origin origin, std::string_view source) |
The named parameters of inst take the shared values again; for kAllInstruments, every instrument does: publish_as() with ParamUpdateMsg::kReset. | |
| std::optional< std::string > | build (const std::vector< ParamValue > &values, InstrumentId inst, ParamUpdateMsg &out, std::uint8_t arm=ParamUpdateMsg::kArmKeep, std::uint8_t flags=0) const |
| The update publish() would send, without sending it or changing the copy; the error message when it is invalid. | |
| void | close () |
| Later publishes return false (the session has stopped). | |
| bool | closed () const |
| std::uint64_t | published () const |
| Updates sent, and updates the sink refused. | |
| std::uint64_t | refused () const |
| const ParamSchema & | schema () const |
| bool | per_instrument () const noexcept |
| An update may name one instrument: the strategy keeps a parameter set per instrument. | |
| std::vector< Value > | values (InstrumentId inst=kAllInstruments) const |
| std::string | describe (InstrumentId inst=kAllInstruments) const |
name=value pairs of the copy: one instrument's, or the shared set. | |
| std::vector< std::string > | own (InstrumentId inst) const |
| The parameters the instrument holds values of its own for, in schema order; none for kAllInstruments. | |
Static Public Attributes | |
| static constexpr InstrumentId | kAllInstruments = ParamUpdateMsg::kAllInstruments |
| using fastmm::ParamPublisher::ParamValue = std::pair<std::string, std::string> |
name, value as ParamDesc::parse takes
|
inline |
|
inline |
schema's parsers and ops work on blocks like current; schema must outlive the publisher.
< + the shared set, last
|
delete |
|
delete |
|
default |
|
delete |
|
delete |
|
inline |
Validates and sends one update.
Throws std::invalid_argument when it is invalid; returns false when the sink refused it (ring full) or the publisher is closed.
|
inline |
publish() with the update's origin, source (ParamUpdateMsg::source, cut to 39 bytes), [ab] arm (ParamUpdateMsg::arm) and flags.
With ParamUpdateMsg::kReset and an instrument, the values are ignored: the named parameters take the shared values again. The update's publish_seq, 0 when the sink refused it or the publisher is closed.
|
inline |
The named parameters of inst take the shared values again; for kAllInstruments, every instrument does: publish_as() with ParamUpdateMsg::kReset.
|
inline |
The update publish() would send, without sending it or changing the copy; the error message when it is invalid.
out.publish_seq and out.hdr.recv_ts stay zero.
|
inline |
Later publishes return false (the session has stopped).
|
inline |
|
inline |
Updates sent, and updates the sink refused.
|
inline |
|
inline |
|
inlinenoexcept |
An update may name one instrument: the strategy keeps a parameter set per instrument.
|
inline |
|
inline |
name=value pairs of the copy: one instrument's, or the shared set.
|
inline |
The parameters the instrument holds values of its own for, in schema order; none for kAllInstruments.
|
staticconstexpr |