Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::ui::NumericProperty Class Reference

Weak numeric property facade with an owning saved operation observation. Mutation returns a new observation and leaves this proxy's previous saved result unchanged. Errors use the existing scene collector. Copies own neither the widget nor its scene. Copying a proxy/result can allocate in existing diagnostic storage; no implicit numeric conversion exists. More...

#include <ui_ref.hpp>

Public Member Functions

 NumericProperty (const NumericProperty &other)=default
 NumericProperty (NumericProperty &&other)=default
std::expected< double, ManagedError > get () const
std::expected< PropertyUpdate< NumericValue >, ManagedError > result () const
NumericProperty set (double value, std::source_location origin=std::source_location::current())
NumericProperty operator= (double value)
NumericProperty operator= (const NumericProperty &other)

Friends

template<class>
class Ref

Detailed Description

Weak numeric property facade with an owning saved operation observation. Mutation returns a new observation and leaves this proxy's previous saved result unchanged. Errors use the existing scene collector. Copies own neither the widget nor its scene. Copying a proxy/result can allocate in existing diagnostic storage; no implicit numeric conversion exists.

Constructor & Destructor Documentation

◆ NumericProperty() [1/2]

portals::ui::NumericProperty::NumericProperty ( const NumericProperty & other)
default
Parameters
otherObservation copied without reading or changing a numeric source.

◆ NumericProperty() [2/2]

portals::ui::NumericProperty::NumericProperty ( NumericProperty && other)
default
Parameters
otherObservation transferred without reading or changing a numeric source.

Member Function Documentation

◆ get()

std::expected< double, ManagedError > portals::ui::NumericProperty::get ( ) const
Returns
Current checked double or exact owner/thread/frame/model error; no diagnostic is reported.

◆ operator=() [1/2]

NumericProperty portals::ui::NumericProperty::operator= ( const NumericProperty & other)
Parameters
otherSource property read exactly once before writing this target's numeric value.
Returns
New owning assignment observation; this proxy's saved result stays unchanged. No binding or bounds are copied.

◆ operator=() [2/2]

NumericProperty portals::ui::NumericProperty::operator= ( double value)
Parameters
valueReplacement copied during this UI-affine call.
Returns
New owning exact operation observation; this proxy's saved result stays unchanged. Errors are automatically collected.

◆ result()

std::expected< PropertyUpdate< NumericValue >, ManagedError > portals::ui::NumericProperty::result ( ) const
Returns
Exact operation saved in this observation; a fresh proxy returns INVALID_ARGUMENT without reporting. Later mutations through this proxy return new observations and do not replace this saved result.

◆ set()

NumericProperty portals::ui::NumericProperty::set ( double value,
std::source_location origin = std::source_location::current() )
Parameters
valueFinite in-range replacement; never clamped or user-step snapped.
originAssignment site retained by the existing collector on failure.
Returns
New owning operation observation; this proxy's saved result stays unchanged. Equal values return the exact no-op receipt.

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