morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
app.hpp File Reference

App-shell descriptor: menu -> screens (form / wizard / view refs). More...

#include <glaze/glaze.hpp>
#include <string>
#include <string_view>
#include <tuple>
#include "detail/session_common.hpp"
#include "flows.hpp"

Go to the source code of this file.

Classes

struct  morph::app::MenuEntry< Label, ScreenId >
 One app-menu entry: a label and the screen-id it routes to. More...
struct  morph::app::FormScreen< Id, Action >
 A screen backed by one registered action's form. More...
struct  morph::app::WizardScreen< Id, Wizard >
 A screen backed by a registered morph::flows::Wizard. More...
struct  morph::app::App< Title, Menu, Screens >
 The app-shell descriptor: a title, an ordered menu, and the screens it routes to. More...

Macros

#define BRIDGE_REGISTER_APP(A, NAME)
 Specialises morph::app::AppTraits<A> with the string type-id NAME.

Functions

template<typename AppT>
std::string morph::app::appSchemaJson ()
 Generates the app-* JSON document for app-shell type AppT.

Detailed Description

App-shell descriptor: menu -> screens (form / wizard / view refs).

A morph::app::App names an ordered menu and a map of screen-id -> screen, where a screen is a reference to an already-registered action form (FormScreen) or wizard (WizardScreen). appSchemaJson<AppT>() emits the app-* document a renderer loads as its navigation root, replacing "enumerate every schema on one scroll." Purely additive metadata: no new dispatch path, the shell only routes to existing action-forms and wizards. See docs/spec/forms/workflows_navigation.md.

Definition in file app.hpp.

Macro Definition Documentation

◆ BRIDGE_REGISTER_APP

#define BRIDGE_REGISTER_APP ( A,
NAME )
Value:
template <> \
struct morph::app::AppTraits<A> { \
static constexpr std::string_view typeId() noexcept { return NAME; } \
};
Traits specialisation mapping an App type to its string type-id.
Definition app.hpp:112

Specialises morph::app::AppTraits<A> with the string type-id NAME.

Metadata only, exactly like BRIDGE_REGISTER_WIZARD: an app-shell descriptor is never itself executed, only the actions/wizards its screens reference are (see docs/spec/forms/workflows_navigation.md).

Parameters
AConcrete morph::app::App<...> type.
NAMEString literal used as the app's type-id.

Definition at line 159 of file app.hpp.

Function Documentation

◆ appSchemaJson()

template<typename AppT>
std::string morph::app::appSchemaJson ( )
nodiscard

Generates the app-* JSON document for app-shell type AppT.

Emits app-title, an ordered app-menu array ({label, screen} per entry), and an app-screens object mapping each screen's id to {kind, ref}. See docs/spec/forms/workflows_navigation.md for the full key vocabulary.

Template Parameters
AppTConcrete morph::app::App<Title, Menu, Screens> type.
Returns
The app's JSON document. Empty string only if glaze's own JSON writer fails on the assembled DOM (schema generation never throws).

Definition at line 124 of file app.hpp.