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

Weak UI handle to a scene-owned Property, never an owning alias. Copies and destruction of the handle are thread independent. Operations check the captured UI identity before locking the property. Immutable snapshots follow Property's transfer requirements. The Application must outlive the scene, but not this weak handle. More...

#include <managed.hpp>

Public Member Functions

 ManagedState ()=default
 Construct an empty handle; operations return CLOSED.
std::expected< PropertyUpdate< T >, TreeError > set (const T &value) const
std::expected< PropertyUpdate< T >, TreeError > set (T &&value) const
std::expected< std::shared_ptr< const PropertyChange< T > >, TreeError > snapshot () const

Friends

class ManagedScene
class NumericState
struct ui::detail::Access
struct ui::detail::RowAccess
struct detail::ManagedNavigationRecord

Detailed Description

template<std::equality_comparable T>
class portals::ManagedState< T >

Weak UI handle to a scene-owned Property, never an owning alias. Copies and destruction of the handle are thread independent. Operations check the captured UI identity before locking the property. Immutable snapshots follow Property's transfer requirements. The Application must outlive the scene, but not this weak handle.

Template Parameters
TEquality-comparable, transitively owning value satisfying Property<T>'s contract.

Member Function Documentation

◆ set() [1/2]

template<std::equality_comparable T>
std::expected< PropertyUpdate< T >, TreeError > portals::ManagedState< T >::set ( const T & value) const
inline
Parameters
valueCandidate copied by Property after validation.
Returns
Original commit/delivery receipt, WRONG_THREAD, CLOSED, or Property's error.

◆ set() [2/2]

template<std::equality_comparable T>
std::expected< PropertyUpdate< T >, TreeError > portals::ManagedState< T >::set ( T && value) const
inline
Parameters
valueCandidate moved by Property after validation.
Returns
Original commit/delivery receipt, WRONG_THREAD, CLOSED, or Property's error.

◆ snapshot()

template<std::equality_comparable T>
std::expected< std::shared_ptr< const PropertyChange< T > >, TreeError > portals::ManagedState< T >::snapshot ( ) const
inline
Returns
Owning immutable snapshot, WRONG_THREAD, or CLOSED after owner destruction. A stopped scene retains its properties until destruction, allowing a final snapshot.

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