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

Where the generic client's screens and models come from: a server (remote) or an application linked in-process (local). Spec 4 §3. More...

#include <chrono>
#include <cstdint>
#include <expected>
#include <functional>
#include <map>
#include <memory>
#include <optional>
#include <string>
#include <string_view>
#include <vector>
#include "../core/backend.hpp"
#include "../core/bridge.hpp"
#include "../core/executor.hpp"
#include "../reactive/scheduler.hpp"
#include "../session/session.hpp"
#include "../ui/document.hpp"
#include "../ui/explorer.hpp"
#include "../ui/frontend.hpp"
#include "../ui/interpreter.hpp"
#include "../ui/queueing_dispatcher.hpp"
#include "../ui/service.hpp"
#include "../ui/service_client.hpp"
#include "args.hpp"

Go to the source code of this file.

Classes

struct  morph::client::LocalSetup
 What a local application is set up with. More...
struct  morph::client::LocalApp
 An application the client links and runs in-process. More...
class  morph::client::Source
 An AppSource that also hands the shell what it mounts screens with, once it delivered a bundle. More...
struct  morph::client::Source::Transport
 What a concrete source opens with: the bridge's backend and the exchange the UI service is reached by. More...
class  morph::client::RemoteSource
 Fetches the screens from a server (--server), over the transport the frontend calls for. More...
class  morph::client::LocalSource
 Runs a linked application in-process (--app): its models over a LocalBackend, its bundle answered by a UiService in the same process, and verified by the same client as a remote one. More...

Functions

std::vector< std::string > morph::client::clientVocabularies ()
 The vocabularies the generic client speaks.
ui::HelloRequest morph::client::clientHello ()
 The ui-hello the generic client opens with, and sends again on each poll: its vocabularies, and the offer of server-sent events on the connection.
std::expected< std::unique_ptr< Source >, std::string > morph::client::makeSource (Args const &args, std::vector< LocalApp > const &apps)
 The source the client's arguments name: remote for --server, local for --app.

Detailed Description

Where the generic client's screens and models come from: a server (remote) or an application linked in-process (local). Spec 4 §3.

Specified in docs/spec/client/client.md.

Definition in file source.hpp.

Function Documentation

◆ clientVocabularies()

std::vector< std::string > morph::client::clientVocabularies ( )
nodiscard

The vocabularies the generic client speaks.

Returns
Their names: ui/1 and the expression vocabulary.

◆ clientHello()

ui::HelloRequest morph::client::clientHello ( )
nodiscard

The ui-hello the generic client opens with, and sends again on each poll: its vocabularies, and the offer of server-sent events on the connection.

Returns
The request.

◆ makeSource()

std::expected< std::unique_ptr< Source >, std::string > morph::client::makeSource ( Args const & args,
std::vector< LocalApp > const & apps )
nodiscard

The source the client's arguments name: remote for --server, local for --app.

Parameters
argsThe client's options.
appsThe applications linked in-process.
Returns
The source, or why there is none: an --app that names no linked application.