|
morph 0.1.0
Asynchronous bridge between GUI thread and business models
|
An expression of a document, typed by the C++ value it evaluates to (spec 5 §11). More...
#include <author.hpp>
Public Types | |
| using | ValueType = T |
| The C++ type of the value. | |
Public Member Functions | |
| Handle ()=default | |
| An absent handle. | |
| template<typename L> requires detail::Literal<std::remove_cvref_t<L>> && (detail::assignable<detail::LiteralT<L>, T>()) | |
| Handle (L const &literal) | |
| A constant. | |
| template<typename U> requires (!std::same_as<U, T>) && (detail::assignable<U, T>()) | |
| Handle (Handle< U > const &other) | |
| A handle of another value type that can stand for this one. | |
| bool | present () const noexcept |
| Whether the handle holds an expression. | |
| Json const & | json () const |
| The expression's JSON. | |
| template<typename Class, typename Member> requires std::same_as<T, Any> || std::same_as<detail::UnwrappedT<T>, Class> | |
| Handle< Member > | at (Member Class::*member) const |
| A field of the value, by member pointer: a renamed field is a compile error. | |
| Handle< Any > | at (std::string_view field) const |
| A field of the value, by name. | |
| Handle | orElse (Handle const &fallback) const |
| The value, or a fallback when it is null. | |
Static Public Member Functions | |
| static Handle | raw (Json json) |
| A handle over an expression's JSON, for a form no builder spells. | |
An expression of a document, typed by the C++ value it evaluates to (spec 5 §11).
A handle is a JSON expression tree. Operators build calls of the expr/1 library: a + b is add, a < b is lt, a && b is and, !a is not; at reads a field by member pointer, and orElse is coalesce. A default-constructed handle is absent: a builder leaves out the key it would fill.
| T | The C++ type of the value, Any when the screen cannot know it. |
Definition at line 648 of file author.hpp.
| using morph::ui::author::Handle< T >::ValueType = T |
The C++ type of the value.
Definition at line 651 of file author.hpp.
|
inline |
A constant.
| L | The constant's C++ type, which must be able to stand for T. |
| literal | The constant. |
Definition at line 661 of file author.hpp.
|
inline |
A handle of another value type that can stand for this one.
| U | The other value type. |
| other | The handle. |
Definition at line 669 of file author.hpp.
|
inlinestaticnodiscard |
A handle over an expression's JSON, for a form no builder spells.
| json | The expression. |
Definition at line 675 of file author.hpp.
|
inlinenodiscardnoexcept |
Whether the handle holds an expression.
Definition at line 683 of file author.hpp.
|
inlinenodiscard |
The expression's JSON.
| AuthoringError | when the handle is absent. |
Definition at line 688 of file author.hpp.
|
inlinenodiscard |
A field of the value, by member pointer: a renamed field is a compile error.
| Class | The class of the member, the value's type. |
| Member | The member's type. |
| member | The member. |
| AuthoringError | when the handle is not a named read. |
Definition at line 703 of file author.hpp.
|
inlinenodiscard |
A field of the value, by name.
| field | The field, or a dotted path. |
| AuthoringError | when the handle is not a named read. |
Definition at line 711 of file author.hpp.
|
inlinenodiscard |
The value, or a fallback when it is null.
| fallback | The fallback. |
Definition at line 718 of file author.hpp.