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"? | |
The single merge layer.
Build it, add sources in precedence order (built-in first), then resolve. Resolution precedence inside the merged table:
|
default |
Empty resolver (no built-in seed) — used by tests and by callers that want full control over the source list.
| RecognitionResolver & pulp::view::RecognitionResolver::add_source | ( | RecognitionSource | source | ) |
Append a source.
Later sources override earlier ones on key/prefix collision. Returns *this for chaining.
|
inline |
Whether any source contributed at least one entry.
|
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.
| 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.