Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::view::RecognitionResolver Class Reference

The single merge layer. More...

#include <recognition_resolver.hpp>

Public Member Functions

 RecognitionResolver ()=default
 Empty resolver (no built-in seed) — used by tests and by callers that want full control over the source list.
RecognitionResolver & add_source (RecognitionSource source)
 Append a source.
ResolvedControl resolve (const std::string &component_key, const std::string &name) const
 Resolve one node's identity.
bool empty () const
 Whether any source contributed at least one entry.

Static Public Member Functions

static std::optional< RecognitionSource > parse_manifest_json (const std::string &json, const std::string &source_name, std::string *error_out=nullptr)
 Parse a recognition manifest in the flat library-manifest.json shape: { "widgets": { "<name>": { "kind"?

Detailed Description

The single merge layer.

Build it, add sources in precedence order (built-in first), then resolve. Resolution precedence inside the merged table:

  1. component_set_key exact match (authoritative). Later sources win.
  2. name_prefix case-insensitive prefix match (fallback). Later sources win.

Constructor & Destructor Documentation

◆ RecognitionResolver()

pulp::view::RecognitionResolver::RecognitionResolver ( )
default

Empty resolver (no built-in seed) — used by tests and by callers that want full control over the source list.

Member Function Documentation

◆ add_source()

RecognitionResolver & pulp::view::RecognitionResolver::add_source ( RecognitionSource source)

Append a source.

Later sources override earlier ones on key/prefix collision. Returns *this for chaining.

◆ empty()

bool pulp::view::RecognitionResolver::empty ( ) const
inline

Whether any source contributed at least one entry.

◆ parse_manifest_json()

std::optional< RecognitionSource > pulp::view::RecognitionResolver::parse_manifest_json ( const std::string & json,
const std::string & source_name,
std::string * error_out = nullptr )
static

Parse a recognition manifest in the flat library-manifest.json shape: { "widgets": { "<name>": { "kind"?

, "component_set_key", "name_prefix"?, "factory_id"? }, ... } } kind defaults to the widget's map key when omitted (so the built-in shape, which keys by kind, parses directly). On parse failure returns nullopt and, if error_out is non-null, sets a human-readable reason.

◆ resolve()

ResolvedControl pulp::view::RecognitionResolver::resolve ( const std::string & component_key,
const std::string & name ) const

Resolve one node's identity.

component_key is the authoritative signal; name feeds the prefix fallback. An empty/unmatched identity returns matched == false.


The documentation for this class was generated from the following file: