58 std::expected<NumericValue, NumericError>
withValue(
double candidate)
const;
68 NumericRange range_{};
76double nudgeNumeric(
const NumericValue &value,
int direction, std::uint64_t steps = 1) noexcept;
82double snapNumeric(NumericRange range,
double candidate) noexcept;
std::expected< NumericValue, NumericError > withValue(double candidate) const
NumericValue()=default
Construct zero in the default 0..100 range with step one.
bool operator==(const NumericValue &other) const =default
NumericRange range() const noexcept
Definition numeric.hpp:51
static std::expected< NumericValue, NumericError > create(double initial, NumericRange range={})
double value() const noexcept
Definition numeric.hpp:46
Public Portals API.
Definition action.hpp:8
@ INVALID_RANGE
Window exceeds the fixed size, overflows, contradicts BOM extent or excludes the requested anchor.
Definition document_encoding.hpp:98
@ INVALID_TEXT
Projected row is not admitted UTF-8 under the scene text policy.
Definition find_bar.hpp:53
NumericError
Allocation-free numeric validation cause, preserved by managed diagnostics.
Definition numeric.hpp:11
@ NOT_FINITE
A value, bound or step is NaN or infinite.
Definition numeric.hpp:12
@ INITIAL_CONFLICT
An external model was combined with an explicit numeric override.
Definition numeric.hpp:17
@ OUT_OF_RANGE
An explicit value is outside the inclusive bounds.
Definition numeric.hpp:16
@ INVALID_STEP
The user increment is not positive.
Definition numeric.hpp:14
@ UNREPRESENTABLE_STEP
A sub-range increment cannot advance at one of the bounds.
Definition numeric.hpp:15
Owning inclusive bounds and user increment; validated together with a numeric value.
Definition numeric.hpp:22
double step
Positive representable user increment; external values need not lie on its grid.
Definition numeric.hpp:25
double maximum
Inclusive finite upper bound with a finite positive span.
Definition numeric.hpp:24
double minimum
Inclusive finite lower bound, default zero.
Definition numeric.hpp:23
bool operator==(const NumericRange &other) const =default