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

Rule/condition: *lhs > *rhs when both operands are engaged; vacuously satisfied when either is unengaged (a form still being filled in must not fail this comparison prematurely — see forms.md). Compares the operands' engaged values (operator*()) directly — e.g. the underlying math::Rational for Quantity, or DateTime for Timestamp — never the field type's own (possibly throwing, for Quantity) operator<=>. More...

#include <forms.hpp>

Public Member Functions

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

Public Attributes

V A::* lhs
 Pointer to the left-hand member.
V A::* rhs
 Pointer to the right-hand member.

Static Public Attributes

static constexpr detail::RuleKind kind = detail::RuleKind::Greater
 The wire "kind" this node emits: "greater".
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.
static constexpr bool isPresentation = false
 Validation rule (not presentation): participates in the gate.

Detailed Description

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

Rule/condition: *lhs > *rhs when both operands are engaged; vacuously satisfied when either is unengaged (a form still being filled in must not fail this comparison prematurely — see forms.md). Compares the operands' engaged values (operator*()) directly — e.g. the underlying math::Rational for Quantity, or DateTime for Timestamp — never the field type's own (possibly throwing, for Quantity) operator<=>.

Template Parameters
VField member type shared by both operands (must satisfy detail::ComparableField).
AAction type both fields belong to.

Definition at line 1013 of file forms.hpp.

Member Function Documentation

◆ test()

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

Evaluates the comparison against action.

Parameters
actionThe action snapshot to inspect.
Returns
true when either operand is unengaged, or *lhs > *rhs.

Definition at line 1030 of file forms.hpp.

◆ emitNode()

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

Emits this rule's x-rules JSON node.

Returns
{"kind":"greater","fields":["<lhs wire name>","<rhs wire name>"]}.

Definition at line 1041 of file forms.hpp.

Member Data Documentation

◆ lhs

template<typename V, typename A>
V A::* morph::forms::Greater< V, A >::lhs

Pointer to the left-hand member.

Definition at line 1015 of file forms.hpp.

◆ rhs

template<typename V, typename A>
V A::* morph::forms::Greater< V, A >::rhs

Pointer to the right-hand member.

Definition at line 1017 of file forms.hpp.

◆ kind

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

The wire "kind" this node emits: "greater".

Definition at line 1019 of file forms.hpp.

◆ isCondition

template<typename V, typename A>
bool morph::forms::Greater< 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 1023 of file forms.hpp.

◆ isPresentation

template<typename V, typename A>
bool morph::forms::Greater< V, A >::isPresentation = false
staticconstexpr

Validation rule (not presentation): participates in the gate.

Definition at line 1025 of file forms.hpp.


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