Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::ui::ModelValue< T > Class Template Reference

Weak scalar property observation; assignment publishes a value without rebinding the descriptor. More...

#include <ui_value_model.hpp>

Public Member Functions

 ModelValue (const ModelValue &other)=default
std::expected< std::shared_ptr< const PropertyChange< T > >, ManagedError > snapshot () const
std::expected< PropertyUpdate< T >, ManagedError > set (const T &value) const
ModelValue operator= (const T &value)
ModelValue operator= (const ModelValue &source)
std::expected< PropertyUpdate< T >, ManagedError > result () const

Friends

class Model< T >
struct detail::ValueModelAccess

Detailed Description

template<class T>
class portals::ui::ModelValue< T >

Weak scalar property observation; assignment publishes a value without rebinding the descriptor.

Template Parameters
TOwning equality-comparable scalar value; instantiated only for the scalar capability. Checked operations never collect errors. Assignment reports an exact failure through the existing scene collector and returns its immutable operation receipt. Postcommit notification rejection remains a successful PropertyUpdate with notification_error; the committed value is not rolled back.

Constructor & Destructor Documentation

◆ ModelValue()

template<class T>
portals::ui::ModelValue< T >::ModelValue ( const ModelValue< T > & other)
default
Parameters
otherObservation copied without reading or publishing values.

Member Function Documentation

◆ operator=() [1/2]

template<class T>
ModelValue portals::ui::ModelValue< T >::operator= ( const ModelValue< T > & source)
inline
Parameters
sourceSource read once before assignment; no lasting binding or descriptor is copied.
Returns
Exact assignment observation; read/write failures also reach the existing collector.

◆ operator=() [2/2]

template<class T>
ModelValue portals::ui::ModelValue< T >::operator= ( const T & value)
inline
Parameters
valueReplacement copied through checked set; errors also reach the existing collector.
Returns
Owning observation of this exact operation; this original proxy's saved receipt is unchanged.

◆ result()

template<class T>
std::expected< PropertyUpdate< T >, ManagedError > portals::ui::ModelValue< T >::result ( ) const
inline
Returns
This assignment's commit receipt, or INVALID_ARGUMENT before assignment; never reads a scene.

◆ set()

template<class T>
std::expected< PropertyUpdate< T >, ManagedError > portals::ui::ModelValue< T >::set ( const T & value) const
inline
Parameters
valueCandidate copied by the existing Property transaction after validation.
Returns
Exact commit/delivery receipt or checked rejection; no diagnostic is collected. Equal values are silent. Read-only aliases return INVALID_ARGUMENT without constructing a candidate. Value construction/comparison must satisfy Property's non-reentry contract.

◆ snapshot()

template<class T>
std::expected< std::shared_ptr< const PropertyChange< T > >, ManagedError > portals::ui::ModelValue< T >::snapshot ( ) const
inline
Returns
Independent immutable value/revision owner or the original affinity/lifetime/capability error.

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