morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::ui::detail::RtScope Class Reference

One document scope at run time: the screen, a dialog's or drawer's content, a switch case or a row. More...

#include <interpreter.hpp>

Public Member Functions

 RtScope (ScreenCore &screen, std::shared_ptr< RtScope > enclosing, reactive::Signal< Value > const *current, std::size_t depth)
 An empty scope.
 RtScope (RtScope const &)=delete
RtScope & operator= (RtScope const &)=delete
 RtScope (RtScope &&)=delete
RtScope & operator= (RtScope &&)=delete
 ~RtScope ()
 Releases what it owns, and tells the dialog it belongs to.
NameRef const * find (std::string_view name) const
 Resolves a name, innermost scope first.
reactive::Signal< Value > const * innermostRow () const
 The innermost row, from this scope outwards.
RtScope const & policyScope () const
 The innermost scope that decides when errors show and is submitted: a dialog's, or the screen's.
bool ready () const
 Whether every element of the scope is valid and no blocking check of it fails. A tracked read.

Public Attributes

ScreenCore & core
 The screen.
std::shared_ptr< RtScope > parent
 The enclosing scope.
reactive::Signal< Value > const * row = nullptr
 The row of a row scope.
ElementState * owner = nullptr
 The dialog or drawer whose content it is.
std::string showErrors
 touched, submit or always, for a scope that decides it.
reactive::Signal< bool > * submitted = nullptr
 submitted of a scope that decides when errors show.
std::map< std::string, NameRef, std::less<> > names
 Its names.
std::vector< std::unique_ptr< StateSlot > > states
 Its state.
std::vector< std::unique_ptr< ElementState > > elements
 Its elements, in document order.
std::vector< std::unique_ptr< TransferState > > transfers
 Its transfers.
std::vector< std::unique_ptr< ModelAlias > > models
 Its model aliases.
std::vector< std::unique_ptr< QueryRuntime > > queries
 Its queries.
std::vector< std::unique_ptr< MutationRuntime > > mutations
 Its mutations.
std::vector< std::unique_ptr< CheckRuntime > > checks
 Its checks.
reactive::Scope nodes
 The reactive nodes it owns; declared last, so they go first.

Detailed Description

One document scope at run time: the screen, a dialog's or drawer's content, a switch case or a row.

It lives while anything that reads it does: the view nodes lowered in it hold it by shared_ptr, a reply or a timer holds it weakly. It belongs to a ScreenCore, which outlives it.

Definition at line 1644 of file interpreter.hpp.

Constructor & Destructor Documentation

◆ RtScope()

morph::ui::detail::RtScope::RtScope ( ScreenCore & screen,
std::shared_ptr< RtScope > enclosing,
reactive::Signal< Value > const * current,
std::size_t depth )
inline

An empty scope.

Parameters
screenThe screen.
enclosingThe enclosing scope; nullptr for the screen and a component fallback.
currentThe row of a row scope; nullptr otherwise.
depthThe reactive scope depth of what it owns.

Definition at line 3382 of file interpreter.hpp.

◆ ~RtScope()

morph::ui::detail::RtScope::~RtScope ( )
inline

Releases what it owns, and tells the dialog it belongs to.

Definition at line 3390 of file interpreter.hpp.

Member Function Documentation

◆ find()

NameRef const * morph::ui::detail::RtScope::find ( std::string_view name) const
inlinenodiscard

Resolves a name, innermost scope first.

Parameters
nameThe name.
Returns
The declaration, or nullptr.

Definition at line 1665 of file interpreter.hpp.

◆ innermostRow()

reactive::Signal< Value > const * morph::ui::detail::RtScope::innermostRow ( ) const
inlinenodiscard

The innermost row, from this scope outwards.

Returns
The row signal, or nullptr.

Definition at line 1677 of file interpreter.hpp.

◆ policyScope()

RtScope const & morph::ui::detail::RtScope::policyScope ( ) const
inlinenodiscard

The innermost scope that decides when errors show and is submitted: a dialog's, or the screen's.

Returns
The scope.

Definition at line 1688 of file interpreter.hpp.

◆ ready()

bool morph::ui::detail::RtScope::ready ( ) const
inlinenodiscard

Whether every element of the scope is valid and no blocking check of it fails. A tracked read.

Returns
It.

Definition at line 3403 of file interpreter.hpp.

Member Data Documentation

◆ core

ScreenCore& morph::ui::detail::RtScope::core

The screen.

Definition at line 1701 of file interpreter.hpp.

◆ parent

std::shared_ptr<RtScope> morph::ui::detail::RtScope::parent

The enclosing scope.

Definition at line 1703 of file interpreter.hpp.

◆ row

reactive::Signal<Value> const* morph::ui::detail::RtScope::row = nullptr

The row of a row scope.

Definition at line 1705 of file interpreter.hpp.

◆ owner

ElementState* morph::ui::detail::RtScope::owner = nullptr

The dialog or drawer whose content it is.

Definition at line 1707 of file interpreter.hpp.

◆ showErrors

std::string morph::ui::detail::RtScope::showErrors

touched, submit or always, for a scope that decides it.

Definition at line 1709 of file interpreter.hpp.

◆ submitted

reactive::Signal<bool>* morph::ui::detail::RtScope::submitted = nullptr

submitted of a scope that decides when errors show.

Definition at line 1711 of file interpreter.hpp.

◆ names

std::map<std::string, NameRef, std::less<> > morph::ui::detail::RtScope::names

Its names.

Definition at line 1713 of file interpreter.hpp.

◆ states

std::vector<std::unique_ptr<StateSlot> > morph::ui::detail::RtScope::states

Its state.

Definition at line 1715 of file interpreter.hpp.

◆ elements

std::vector<std::unique_ptr<ElementState> > morph::ui::detail::RtScope::elements

Its elements, in document order.

Definition at line 1717 of file interpreter.hpp.

◆ transfers

std::vector<std::unique_ptr<TransferState> > morph::ui::detail::RtScope::transfers

Its transfers.

Definition at line 1719 of file interpreter.hpp.

◆ models

std::vector<std::unique_ptr<ModelAlias> > morph::ui::detail::RtScope::models

Its model aliases.

Definition at line 1721 of file interpreter.hpp.

◆ queries

std::vector<std::unique_ptr<QueryRuntime> > morph::ui::detail::RtScope::queries

Its queries.

Definition at line 1723 of file interpreter.hpp.

◆ mutations

std::vector<std::unique_ptr<MutationRuntime> > morph::ui::detail::RtScope::mutations

Its mutations.

Definition at line 1725 of file interpreter.hpp.

◆ checks

std::vector<std::unique_ptr<CheckRuntime> > morph::ui::detail::RtScope::checks

Its checks.

Definition at line 1727 of file interpreter.hpp.

◆ nodes

reactive::Scope morph::ui::detail::RtScope::nodes

The reactive nodes it owns; declared last, so they go first.

Definition at line 1729 of file interpreter.hpp.


The documentation for this class was generated from the following file: