Compound condition: all of Conds... hold. Nests to any depth — each Cond may itself be a leaf (Engaged, Equals, a comparison, …) or another And/Or/Not. Usable both as a nested when clause and directly as a top-level formRules entry (it declares isPresentation and test() exactly like every other validation rule), which is what lets a single rule carry a compound condition tree instead of factoring the composition into multiple single-condition rules.
More...
#include <forms.hpp>
|
| 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.
|
|
| std::tuple< Conds... > | conditions |
| | The nested conditions, in declaration order.
|
|
| static constexpr detail::RuleKind | kind = detail::RuleKind::And |
| | The wire "kind" this node emits: "and".
|
| 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.
|
template<typename A, typename... Conds>
struct morph::forms::And< A, Conds >
Compound condition: all of Conds... hold. Nests to any depth — each Cond may itself be a leaf (Engaged, Equals, a comparison, …) or another And/Or/Not. Usable both as a nested when clause and directly as a top-level formRules entry (it declares isPresentation and test() exactly like every other validation rule), which is what lets a single rule carry a compound condition tree instead of factoring the composition into multiple single-condition rules.
- Template Parameters
-
| A | Action type every nested condition ranges over. |
| Conds | Nested condition node types, at least two. |
Definition at line 1749 of file forms.hpp.
◆ test()
template<typename A, typename... Conds>
|
|
inlinenodiscardconstexprnoexcept |
Evaluates the condition against action.
- Parameters
-
| action | The action snapshot to inspect. |
- Returns
- true when every nested condition holds.
Definition at line 1765 of file forms.hpp.
◆ emitNode()
template<typename A, typename... Conds>
◆ conditions
template<typename A, typename... Conds>
The nested conditions, in declaration order.
Definition at line 1751 of file forms.hpp.
◆ kind
template<typename A, typename... Conds>
◆ isCondition
template<typename A, typename... Conds>
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 1757 of file forms.hpp.
◆ isPresentation
template<typename A, typename... Conds>
Validation rule (not presentation): participates in the gate when used as a top-level formRules entry.
Definition at line 1760 of file forms.hpp.
The documentation for this struct was generated from the following file: