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

Switch bool property observing the original Ref slot; never owns a widget or scene. No implicit boolean conversion exists: get() returns the authoritative checked bool. More...

#include <ui_ref.hpp>

Public Member Functions

 CheckedProperty (const CheckedProperty &)=default
 Copy an observation without reading or changing either model.
 CheckedProperty (CheckedProperty &&)=default
 Transfer an observation; the source remains a valid empty/moved observation.
CheckedProperty operator= (const CheckedProperty &source)
 Copy the source bool into this original destination; never rebind either proxy.
std::expected< bool, ManagedError > get () const
std::expected< PropertyUpdate< bool >, ManagedError > set (bool value, std::source_location origin=std::source_location::current())
CheckedProperty operator= (bool value)
std::expected< PropertyUpdate< bool >, ManagedError > result () const

Friends

template<class>
class Ref

Detailed Description

Switch bool property observing the original Ref slot; never owns a widget or scene. No implicit boolean conversion exists: get() returns the authoritative checked bool.

Member Function Documentation

◆ get()

std::expected< bool, ManagedError > portals::ui::CheckedProperty::get ( ) const
inline
Returns
Authoritative bool or exact affinity/lifetime/model failure; reads do not report.

◆ operator=() [1/2]

CheckedProperty portals::ui::CheckedProperty::operator= ( bool value)
inline
Parameters
valueReplacement bool.
Returns
Owning observation carrying this exact receipt; ignored failures still reach onError. Uses checked() origin. Pins the slot before callbacks, without reusing a possibly destroyed proxy.

◆ operator=() [2/2]

CheckedProperty portals::ui::CheckedProperty::operator= ( const CheckedProperty & source)
inline

Copy the source bool into this original destination; never rebind either proxy.

Parameters
sourceObserving source read once before writing.
Returns
Destination observation with exact receipt.

◆ result()

std::expected< PropertyUpdate< bool >, ManagedError > portals::ui::CheckedProperty::result ( ) const
inline
Returns
This returned assignment observation's exact receipt; INVALID_ARGUMENT before assignment. No scene access.

◆ set()

std::expected< PropertyUpdate< bool >, ManagedError > portals::ui::CheckedProperty::set ( bool value,
std::source_location origin = std::source_location::current() )
inline
Parameters
valueReplacement bool.
originExplicit mutation site.
Returns
Exact Property receipt; errors also enter the existing collector as switch.checked.

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