Process-level registry mapping a view's string type-id to its viewSchemaJson<V>() provider, so a controller can enumerate every registered view by name — parallels ActionExecuteRegistry for actions (docs/spec/core/bridge.md), but a view registers no executor, only a schema provider.
More...
#include <views.hpp>
|
| template<typename V> |
| void | registerView (std::string_view viewId) |
| | Registers V's schema provider under viewId. A second registration for the same viewId silently replaces the first (last-write-wins, the same policy ActionDispatcher and ModelRegistryFactory use — see docs/spec/core/registry.md).
|
| const std::string & | schemaJson (std::string_view viewId) const |
| | Returns the cached viewSchemaJson<V>() for viewId.
|
| std::vector< std::string > | viewIds () const |
| | Returns every registered view id, in unspecified order.
|
Process-level registry mapping a view's string type-id to its viewSchemaJson<V>() provider, so a controller can enumerate every registered view by name — parallels ActionExecuteRegistry for actions (docs/spec/core/bridge.md), but a view registers no executor, only a schema provider.
Definition at line 576 of file views.hpp.
◆ registerView()
template<typename V>
| void morph::views::ViewRegistry::registerView |
( |
std::string_view | viewId | ) |
|
|
inline |
Registers V's schema provider under viewId. A second registration for the same viewId silently replaces the first (last-write-wins, the same policy ActionDispatcher and ModelRegistryFactory use — see docs/spec/core/registry.md).
- Template Parameters
-
| V | Concrete view descriptor type. |
- Parameters
-
Definition at line 585 of file views.hpp.
◆ schemaJson()
| const std::string & morph::views::ViewRegistry::schemaJson |
( |
std::string_view | viewId | ) |
const |
|
inlinenodiscard |
Returns the cached viewSchemaJson<V>() for viewId.
Forwards the provider's reference through unchanged, so enumerating every registered view copies no schema text; the referent is viewSchemaJson<V>()'s process-lifetime cache.
- Parameters
-
- Returns
- Reference to the process-lifetime view-schema JSON registered under
viewId.
- Exceptions
-
| std::runtime_error | if no view is registered under viewId. |
Definition at line 601 of file views.hpp.
◆ viewIds()
| std::vector< std::string > morph::views::ViewRegistry::viewIds |
( |
| ) |
const |
|
inlinenodiscard |
Returns every registered view id, in unspecified order.
- Returns
- The registered view ids.
Definition at line 611 of file views.hpp.
◆ instance()
Returns the process-level singleton registry.
- Returns
- Reference to the singleton.
Definition at line 622 of file views.hpp.
The documentation for this class was generated from the following file: