morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::ui::StaticEnvironment Class Referencefinal

An environment that holds its values: for tests, and for evaluating outside a mounted screen. More...

#include <expression.hpp>

Inheritance diagram for morph::ui::StaticEnvironment:
morph::ui::Environment

Public Member Functions

Value ref (std::string_view head, std::span< std::string const > path) const override
 Reads a name and walks its path.
Value row (std::span< std::string const > path) const override
 Walks the row.
Value control (ExprKind form, std::string_view name) const override
 Reads a control form from the maps.
Value pref (std::string_view point, std::span< std::string const > path) const override
 Reads a customization choice.
Value client (ExprKind form, std::string_view name) const override
 Reads env, session or host.
FormatContext const & formatting () const override
 The formatting facts.
void report (std::string_view path, std::string_view reason) const override
 Records a runtime error, once per path.
Public Member Functions inherited from morph::ui::Environment
 Environment (Environment const &)=delete
Environment & operator= (Environment const &)=delete
 Environment (Environment &&)=delete
Environment & operator= (Environment &&)=delete

Public Attributes

ValueRecord names
 The values ref reads, by head name.
Value rowValue
 The innermost row.
ValueRecord queries
 Query values, by name.
ValueRecord results
 Mutation results, by name.
ValueRecord errors
 Error texts, by query or mutation name.
ValueRecord errorKinds
 Error kinds, by query or mutation name.
std::set< std::string, std::less<> > pendingNames
 The queries and mutations in flight.
std::set< std::string, std::less<> > permitted
 What the principal may run.
ValueRecord prefs
 Customization choices, by point.
ValueRecord environment
 env values.
ValueRecord session
 session values.
ValueRecord host
 host values.
FormatContext format
 The formatting facts.
std::vector< Refusal > diagnostics
 The runtime errors reported, each path once.

Detailed Description

An environment that holds its values: for tests, and for evaluating outside a mounted screen.

Each runtime error is recorded once per expression path in diagnostics.

Definition at line 2058 of file expression.hpp.

Member Function Documentation

◆ ref()

Value morph::ui::StaticEnvironment::ref ( std::string_view head,
std::span< std::string const > path ) const
inlinenodiscardoverridevirtual

Reads a name and walks its path.

Parameters
headThe name.
pathThe path.
Returns
The value, or null.

Implements morph::ui::Environment.

Definition at line 2093 of file expression.hpp.

◆ row()

Value morph::ui::StaticEnvironment::row ( std::span< std::string const > path) const
inlinenodiscardoverridevirtual

Walks the row.

Parameters
pathThe path.
Returns
The value, or null.

Implements morph::ui::Environment.

Definition at line 2100 of file expression.hpp.

◆ control()

Value morph::ui::StaticEnvironment::control ( ExprKind form,
std::string_view name ) const
inlinenodiscardoverridevirtual

Reads a control form from the maps.

Parameters
formThe form.
nameThe query or mutation.
Returns
The value.

Implements morph::ui::Environment.

Definition at line 2106 of file expression.hpp.

◆ pref()

Value morph::ui::StaticEnvironment::pref ( std::string_view point,
std::span< std::string const > path ) const
inlinenodiscardoverridevirtual

Reads a customization choice.

Parameters
pointThe point.
pathThe path.
Returns
The value, or null.

Implements morph::ui::Environment.

Definition at line 2126 of file expression.hpp.

◆ client()

Value morph::ui::StaticEnvironment::client ( ExprKind form,
std::string_view name ) const
inlinenodiscardoverridevirtual

Reads env, session or host.

Parameters
formThe form.
nameThe name.
Returns
The value, or null.

Implements morph::ui::Environment.

Definition at line 2134 of file expression.hpp.

◆ formatting()

FormatContext const & morph::ui::StaticEnvironment::formatting ( ) const
inlinenodiscardoverridevirtual

The formatting facts.

Returns
format.

Implements morph::ui::Environment.

Definition at line 2143 of file expression.hpp.

◆ report()

void morph::ui::StaticEnvironment::report ( std::string_view path,
std::string_view reason ) const
inlineoverridevirtual

Records a runtime error, once per path.

Parameters
pathThe expression node's path.
reasonWhat went wrong.

Implements morph::ui::Environment.

Definition at line 2148 of file expression.hpp.

Member Data Documentation

◆ names

ValueRecord morph::ui::StaticEnvironment::names

The values ref reads, by head name.

Definition at line 2061 of file expression.hpp.

◆ rowValue

Value morph::ui::StaticEnvironment::rowValue

The innermost row.

Definition at line 2063 of file expression.hpp.

◆ queries

ValueRecord morph::ui::StaticEnvironment::queries

Query values, by name.

Definition at line 2065 of file expression.hpp.

◆ results

ValueRecord morph::ui::StaticEnvironment::results

Mutation results, by name.

Definition at line 2067 of file expression.hpp.

◆ errors

ValueRecord morph::ui::StaticEnvironment::errors

Error texts, by query or mutation name.

Definition at line 2069 of file expression.hpp.

◆ errorKinds

ValueRecord morph::ui::StaticEnvironment::errorKinds

Error kinds, by query or mutation name.

Definition at line 2071 of file expression.hpp.

◆ pendingNames

std::set<std::string, std::less<> > morph::ui::StaticEnvironment::pendingNames

The queries and mutations in flight.

Definition at line 2073 of file expression.hpp.

◆ permitted

std::set<std::string, std::less<> > morph::ui::StaticEnvironment::permitted

What the principal may run.

Definition at line 2075 of file expression.hpp.

◆ prefs

ValueRecord morph::ui::StaticEnvironment::prefs

Customization choices, by point.

Definition at line 2077 of file expression.hpp.

◆ environment

ValueRecord morph::ui::StaticEnvironment::environment

env values.

Definition at line 2079 of file expression.hpp.

◆ session

ValueRecord morph::ui::StaticEnvironment::session

session values.

Definition at line 2081 of file expression.hpp.

◆ host

ValueRecord morph::ui::StaticEnvironment::host

host values.

Definition at line 2083 of file expression.hpp.

◆ format

FormatContext morph::ui::StaticEnvironment::format

The formatting facts.

Definition at line 2085 of file expression.hpp.

◆ diagnostics

std::vector<Refusal> morph::ui::StaticEnvironment::diagnostics
mutable

The runtime errors reported, each path once.

Definition at line 2087 of file expression.hpp.


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