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

Cold explicit shared navigation; ordinary model-source views stay independent. More...

#include <ui_model.hpp>

Public Types

using Row = T
 Common domain row of the explicit navigation session.

Public Member Functions

 Navigation ()=default
 Create an empty context descriptor whose checked use reports INVALID_ARGUMENT.
std::expected< ManagedNavigation, ManagedError > managed () const
 Obtain the published context without extending scene lifetime.
std::expected< std::optional< RowId >, ManagedError > currentRow () const
 Read the current model-local item key from the existing managed navigation channel.
Model< NavigationPosition > current () const
 Observe the accepted navigation channel as a cold read-only scalar model.
std::expected< void, ManagedError > setModel (Model< T > target, ModelRebindOptions options={}) const
 Admit one model change for the complete shared group on its UI thread.
bool model (Model< T > target, ModelRebindOptions options={}, std::source_location origin=std::source_location::current()) const
 Change the shared model and report a checked failure through existing scene diagnostics.

Friends

struct detail::ModelAccess
struct detail::EditAccess

Detailed Description

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

Cold explicit shared navigation; ordinary model-source views stay independent.

Template Parameters
TCommon domain row of the context's model and participating views.

Member Function Documentation

◆ current()

template<class T>
Model< NavigationPosition > portals::ui::Navigation< T >::current ( ) const

Observe the accepted navigation channel as a cold read-only scalar model.

Returns
Descriptor resolved with this navigation in the receiving mount transaction. No mirror value or additional Property is created; writes report INVALID_ARGUMENT.

◆ currentRow()

template<class T>
std::expected< std::optional< RowId >, ManagedError > portals::ui::Navigation< T >::currentRow ( ) const
inline

Read the current model-local item key from the existing managed navigation channel.

Returns
Logical current RowId, successful nullopt for no current item, or the original cold, closed, wrong-thread or channel access failure. No alias is registered or rows read. The key does not promise materialized data; update() validates its current existence independently.

◆ managed()

template<class T>
std::expected< ManagedNavigation, ManagedError > portals::ui::Navigation< T >::managed ( ) const
inline

Obtain the published context without extending scene lifetime.

Returns
Weak navigation handle, CLOSED before publication/after close, or a typed handle/thread failure.

◆ model()

template<class T>
bool portals::ui::Navigation< T >::model ( Model< T > target,
ModelRebindOptions options = {},
std::source_location origin = std::source_location::current() ) const
inline

Change the shared model and report a checked failure through existing scene diagnostics.

Parameters
targetCold destination source in this scene.
optionsExisting remember/reset policy.
originOriginal command site attached to a reported failure.
Returns
True on success; false after reporting the original checked error.

◆ setModel()

template<class T>
std::expected< void, ManagedError > portals::ui::Navigation< T >::setModel ( Model< T > target,
ModelRebindOptions options = {} ) const

Admit one model change for the complete shared group on its UI thread.

Parameters
targetCold destination source in this scene.
optionsExisting remember/reset policy; default same-model use preserves navigation.
Returns
Success or typed admission failure; failed admission retains the installed group.

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