morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::forms::Engaged< V, A > Struct Template Reference

Condition: field is engaged (has a value). One of the closed condition kinds a requiredWhen / visibleWhen / readonlyWhen rule's when clause accepts. More...

#include <forms.hpp>

Public Member Functions

constexpr bool test (const A &action) const noexcept
 Evaluates the condition against action.
glz::generic_u64 emitNode () const
 Emits this condition's x-rules JSON node.

Public Attributes

V A::* field
 Pointer to the member this condition inspects.

Static Public Attributes

static constexpr detail::RuleKind kind = detail::RuleKind::Engaged
 The wire "kind" this condition emits: "engaged".
static constexpr bool isCondition = true
 Usable as a nested condition: this node's test() is a function of the action, so composing it into an and/or/not tree changes what that tree evaluates to.

Detailed Description

template<typename V, typename A>
struct morph::forms::Engaged< V, A >

Condition: field is engaged (has a value). One of the closed condition kinds a requiredWhen / visibleWhen / readonlyWhen rule's when clause accepts.

Template Parameters
VField member type (must satisfy EngageableField).
AAction type the field belongs to.

Definition at line 919 of file forms.hpp.

Member Function Documentation

◆ test()

template<typename V, typename A>
bool morph::forms::Engaged< V, A >::test ( const A & action) const
inlinenodiscardconstexprnoexcept

Evaluates the condition against action.

Parameters
actionThe action snapshot to inspect.
Returns
true when the field is engaged.

Definition at line 932 of file forms.hpp.

◆ emitNode()

template<typename V, typename A>
glz::generic_u64 morph::forms::Engaged< V, A >::emitNode ( ) const
inlinenodiscard

Emits this condition's x-rules JSON node.

Returns
{"kind":"engaged","fields":["<wire name>"]}.

Definition at line 936 of file forms.hpp.

Member Data Documentation

◆ field

template<typename V, typename A>
V A::* morph::forms::Engaged< V, A >::field

Pointer to the member this condition inspects.

Definition at line 921 of file forms.hpp.

◆ kind

template<typename V, typename A>
detail::RuleKind morph::forms::Engaged< V, A >::kind = detail::RuleKind::Engaged
staticconstexpr

The wire "kind" this condition emits: "engaged".

Definition at line 923 of file forms.hpp.

◆ isCondition

template<typename V, typename A>
bool morph::forms::Engaged< V, A >::isCondition = true
staticconstexpr

Usable as a nested condition: this node's test() is a function of the action, so composing it into an and/or/not tree changes what that tree evaluates to.

Definition at line 927 of file forms.hpp.


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