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

Weak UI handle to a model owned by one ManagedScene. Handles may be copied and destroyed on any thread. Operations require the creating UI thread. Closing the scene closes its model endpoints; handles do not extend ownership. More...

#include <managed_model.hpp>

Public Member Functions

 ManagedModel ()=default
 Construct an empty handle whose operations return CLOSED.
std::expected< void, TreeError > setChangeMap (PositionChangeMap changes) const
std::expected< Publisher< ModelSnapshot< T > >, TreeError > publisher () const
 Copy the existing worker-safe publication endpoint on UI.

Friends

class ManagedScene
struct ui::detail::Access
struct ui::detail::RowAccess
struct detail::ManagedModelAccess

Detailed Description

template<class T>
class portals::ManagedModel< T >

Weak UI handle to a model owned by one ManagedScene. Handles may be copied and destroyed on any thread. Operations require the creating UI thread. Closing the scene closes its model endpoints; handles do not extend ownership.

Template Parameters
TImmutable domain row satisfying Model<T>'s snapshot and destruction contract.

Member Function Documentation

◆ publisher()

template<class T>
std::expected< Publisher< ModelSnapshot< T > >, TreeError > portals::ManagedModel< T >::publisher ( ) const
inline

Copy the existing worker-safe publication endpoint on UI.

Returns
Publisher for newer snapshots, WRONG_THREAD, or CLOSED after scene cleanup. Collection-bound sink-only models return WOULD_BLOCK instead of exposing a writable endpoint. A rejected publication remains the provider's responsibility; retain and retry its value.

◆ setChangeMap()

template<class T>
std::expected< void, TreeError > portals::ManagedModel< T >::setChangeMap ( PositionChangeMap changes) const
inline
Parameters
changesComplete bounded ordering proof for a published destination revision.
Returns
UI-affine admission, or checked access failure; this does not publish model data. Remembered positions use this proof only when its endpoint matches the current snapshot.

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