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

Submitters and choice fetchers bound to an application's own BridgeHandlers. More...

#include <exception>
#include <functional>
#include <optional>
#include <stdexcept>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include "../../core/bridge.hpp"
#include "../../core/completion.hpp"
#include "../../core/executor.hpp"
#include "form_session.hpp"

Go to the source code of this file.

Functions

template<class... Handlers>
requires (sizeof...(Handlers) > 0)
Submitter morph::forms::handlerSubmitter (exec::IExecutor &callbacks, Handlers &... handlers)
 A Submitter that sends each action through the first of handlers whose model registers it.
template<class... Handlers>
requires (sizeof...(Handlers) > 0)
ChoiceFetcher morph::forms::handlerChoiceFetcher (exec::IExecutor &callbacks, Handlers &... handlers)
 A ChoiceFetcher that runs each options action through the first of handlers that serves it.

Detailed Description

Submitters and choice fetchers bound to an application's own BridgeHandlers.

Specified in docs/spec/forms/engine.md, "Submitters".

Definition in file handler_submitter.hpp.

Function Documentation

◆ handlerSubmitter()

template<class... Handlers>
requires (sizeof...(Handlers) > 0)
Submitter morph::forms::handlerSubmitter ( exec::IExecutor & callbacks,
Handlers &... handlers )
nodiscard

A Submitter that sends each action through the first of handlers whose model registers it.

Use it when a form's submissions must reach the model instance the rest of the screen uses — an in-memory model, or a shared instance another handler attached. bridgeSubmitter keeps handlers of its own instead.

Template Parameters
Handlersbridge::BridgeHandler<M, S> types.
Parameters
callbacksThe executor a refusal is delivered on: the handlers' GUI executor.
handlersThe handlers, in priority order; they must outlive the returned submitter.
Returns
The submitter.

Definition at line 79 of file handler_submitter.hpp.

◆ handlerChoiceFetcher()

template<class... Handlers>
requires (sizeof...(Handlers) > 0)
ChoiceFetcher morph::forms::handlerChoiceFetcher ( exec::IExecutor & callbacks,
Handlers &... handlers )
nodiscard

A ChoiceFetcher that runs each options action through the first of handlers that serves it.

Template Parameters
Handlersbridge::BridgeHandler<M, S> types.
Parameters
callbacksThe executor a refusal is delivered on: the handlers' GUI executor.
handlersThe handlers, in priority order; they must outlive the returned fetcher.
Returns
The fetcher.

Definition at line 93 of file handler_submitter.hpp.