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

Rule: at least one of the listed fields is engaged. More...

#include <forms.hpp>

Public Member Functions

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

Public Attributes

std::tuple< Vs A::*... > fields
 Pointers to the member fields this rule ranges over.

Static Public Attributes

static constexpr detail::RuleKind kind = detail::RuleKind::AtLeastOneOf
 The wire "kind" this rule emits: "atLeastOneOf".
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 A, typename... Vs>
struct morph::forms::AtLeastOneOf< A, Vs >

Rule: at least one of the listed fields is engaged.

Template Parameters
AAction type all fields belong to.
VsField member types, one per listed field (must each satisfy EngageableField).

Definition at line 1531 of file forms.hpp.

Member Function Documentation

◆ test()

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

Evaluates the rule against action.

Parameters
actionThe action snapshot to inspect.
Returns
true when at least one listed field is engaged.

Definition at line 1546 of file forms.hpp.

◆ emitNode()

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

Emits this rule's x-rules JSON node.

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

Definition at line 1555 of file forms.hpp.

Member Data Documentation

◆ fields

template<typename A, typename... Vs>
std::tuple<Vs A::*...> morph::forms::AtLeastOneOf< A, Vs >::fields

Pointers to the member fields this rule ranges over.

Definition at line 1533 of file forms.hpp.

◆ kind

template<typename A, typename... Vs>
detail::RuleKind morph::forms::AtLeastOneOf< A, Vs >::kind = detail::RuleKind::AtLeastOneOf
staticconstexpr

The wire "kind" this rule emits: "atLeastOneOf".

Definition at line 1535 of file forms.hpp.

◆ isCondition

template<typename A, typename... Vs>
bool morph::forms::AtLeastOneOf< A, Vs >::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 1539 of file forms.hpp.

◆ isPresentation

template<typename A, typename... Vs>
bool morph::forms::AtLeastOneOf< A, Vs >::isPresentation = false
staticconstexpr

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

Definition at line 1541 of file forms.hpp.


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