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

Compound condition: at least one of Conds... holds. Nests to any depth, and is usable directly as a top-level formRules entry, exactly like And. 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

std::tuple< Conds... > conditions
 The nested conditions, in declaration order.

Static Public Attributes

static constexpr detail::RuleKind kind = detail::RuleKind::Or
 The wire "kind" this node emits: "or".
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 when used as a top-level formRules entry.

Detailed Description

template<typename A, typename... Conds>
struct morph::forms::Or< A, Conds >

Compound condition: at least one of Conds... holds. Nests to any depth, and is usable directly as a top-level formRules entry, exactly like And.

Template Parameters
AAction type every nested condition ranges over.
CondsNested condition node types, at least two.

Definition at line 1809 of file forms.hpp.

Member Function Documentation

◆ test()

template<typename A, typename... Conds>
bool morph::forms::Or< A, Conds >::test ( const A & action) const
inlinenodiscardconstexprnoexcept

Evaluates the condition against action.

Parameters
actionThe action snapshot to inspect.
Returns
true when at least one nested condition holds.

Definition at line 1825 of file forms.hpp.

◆ emitNode()

template<typename A, typename... Conds>
glz::generic_u64 morph::forms::Or< A, Conds >::emitNode ( ) const
inlinenodiscard

Emits this condition's x-rules JSON node.

Returns
{"kind":"or","conditions":[{...}, ...]}.

Definition at line 1831 of file forms.hpp.

Member Data Documentation

◆ conditions

template<typename A, typename... Conds>
std::tuple<Conds...> morph::forms::Or< A, Conds >::conditions

The nested conditions, in declaration order.

Definition at line 1811 of file forms.hpp.

◆ kind

template<typename A, typename... Conds>
detail::RuleKind morph::forms::Or< A, Conds >::kind = detail::RuleKind::Or
staticconstexpr

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

Definition at line 1813 of file forms.hpp.

◆ isCondition

template<typename A, typename... Conds>
bool morph::forms::Or< A, Conds >::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 1817 of file forms.hpp.

◆ isPresentation

template<typename A, typename... Conds>
bool morph::forms::Or< A, Conds >::isPresentation = false
staticconstexpr

Validation rule (not presentation): participates in the gate when used as a top-level formRules entry.

Definition at line 1820 of file forms.hpp.


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