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

Compound condition: the nested condition does not hold. Nests to any depth, and is usable directly as a top-level formRules entry, exactly like And/Or. 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

Cond condition
 The negated condition.

Static Public Attributes

static constexpr detail::RuleKind kind = detail::RuleKind::Not
 The wire "kind" this node emits: "not".
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 Cond>
struct morph::forms::Not< A, Cond >

Compound condition: the nested condition does not hold. Nests to any depth, and is usable directly as a top-level formRules entry, exactly like And/Or.

Template Parameters
AAction type the nested condition ranges over.
CondNested condition node type.

Definition at line 1864 of file forms.hpp.

Member Function Documentation

◆ test()

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

Evaluates the condition against action.

Parameters
actionThe action snapshot to inspect.
Returns
true when the nested condition does not hold.

Definition at line 1880 of file forms.hpp.

◆ emitNode()

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

Emits this condition's x-rules JSON node.

Returns
{"kind":"not","condition":{...}}.

Definition at line 1884 of file forms.hpp.

Member Data Documentation

◆ condition

template<typename A, typename Cond>
Cond morph::forms::Not< A, Cond >::condition

The negated condition.

Definition at line 1866 of file forms.hpp.

◆ kind

template<typename A, typename Cond>
detail::RuleKind morph::forms::Not< A, Cond >::kind = detail::RuleKind::Not
staticconstexpr

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

Definition at line 1868 of file forms.hpp.

◆ isCondition

template<typename A, typename Cond>
bool morph::forms::Not< A, Cond >::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 1872 of file forms.hpp.

◆ isPresentation

template<typename A, typename Cond>
bool morph::forms::Not< A, Cond >::isPresentation = false
staticconstexpr

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

Definition at line 1875 of file forms.hpp.


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