|
morph 0.1.0
Asynchronous bridge between GUI thread and business models
|
Development reload (spec 5 §12): which documents a changed bundle changed, and remounting the mounted screens that show them, keeping their state. More...
#include <algorithm>#include <functional>#include <map>#include <memory>#include <span>#include <string>#include <string_view>#include <utility>#include <vector>#include "bundle.hpp"#include "document.hpp"#include "frontend.hpp"#include "host.hpp"#include "value.hpp"Go to the source code of this file.
Classes | |
| struct | morph::ui::MountedScreen |
| A mounted screen a reload may remount. More... | |
| struct | morph::ui::ReloadOutcome |
| What reloadDocuments did. More... | |
Typedefs | |
| using | morph::ui::DocumentMap = std::map<std::string, std::shared_ptr<Document const>, std::less<>> |
| The loaded documents a host mounts from, by screen id. | |
Functions | |
| std::vector< std::string > | morph::ui::changedDocuments (Manifest const &before, Manifest const &after) |
| The ids of the documents (screens and the app document) whose files differ between two manifests: changed, added or removed. Themes, message catalogues and components are not documents; a document that names a changed component names it by its new hash, so it changes too. | |
| ReloadOutcome | morph::ui::reloadDocuments (std::span< std::string const > changed, Bundle const &bundle, LoadOptions const &options, DocumentMap &documents, DocumentScreenHost &host, std::span< MountedScreen const > mounted) |
| Loads the changed documents of a new bundle and remounts the mounted screens that show them. | |
Development reload (spec 5 §12): which documents a changed bundle changed, and remounting the mounted screens that show them, keeping their state.
A development client polls with UiClient::poll and hands each changed bundle to reloadDocuments. Specified in docs/spec/ui/service.md.
Definition in file dev_reload.hpp.
| using morph::ui::DocumentMap = std::map<std::string, std::shared_ptr<Document const>, std::less<>> |
The loaded documents a host mounts from, by screen id.
Definition at line 30 of file dev_reload.hpp.
|
inlinenodiscard |
The ids of the documents (screens and the app document) whose files differ between two manifests: changed, added or removed. Themes, message catalogues and components are not documents; a document that names a changed component names it by its new hash, so it changes too.
| before | The manifest the client had. |
| after | The manifest it has now. |
Definition at line 38 of file dev_reload.hpp.
|
inlinenodiscard |
Loads the changed documents of a new bundle and remounts the mounted screens that show them.
Each changed screen document is loaded with options. A document that does not load is refused and keeps the old document, in documents and on every screen showing it. A document that loads is mounted, through DocumentScreenHost::remount, on every screen of mounted showing it, which keeps each state of the screen's own scope declared under the same name and type. A remount the interpreter refuses keeps that screen on the old document, and keeps the old document in documents. A changed id the bundle no longer holds, and the app document, which no DocumentScreenHost mounts, change nothing here.
| changed | The ids of the changed documents (changedDocuments). |
| bundle | The new bundle's documents. |
| options | How the documents load: the catalog facts. |
| documents | The host's documents, updated in place. |
| host | The host that mounted every screen of mounted. |
| mounted | The mounted screens. |
Definition at line 99 of file dev_reload.hpp.