morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::ui::detail::KeyedRow Struct Reference

One mounted row of a ForEach or Table. More...

#include <mount.hpp>

Public Attributes

Key key
 The row's key.
std::unique_ptr< reactive::Scope > stateScope
 Owns the row's slot; made once, for as long as the key is in the data.
RowSlot * slot = nullptr
 The row's slot, owned by stateScope.
std::unique_ptr< reactive::Scope > widgetScope
 Owns the row's widget and its bindings; null while the row is dewindowed or has no view.
Widget * widget = nullptr
 The row's widget, owned by widgetScope; null exactly when widgetScope is null.
RowWidgetState widgetState = RowWidgetState::NullView
 Which of the three states above widget is in.
std::size_t viewPosition = 0
 This row's position in view order, as of the most recent reconcile pass – not its position in KeyedRows::list, which reorder groups realized rows ahead of dewindowed ones within (so the container only ever holds the widgets that exist), and so no longer matches view order once any row is dewindowed. applyWindow compares this against the visible range; reconcile is the only writer.

Detailed Description

One mounted row of a ForEach or Table.

A row's state (its slot, and the signal it reads) and its widget are owned by two separate scopes so a virtualized table can release a row's widget – the expensive part of mounting a row – while its key is still in the data, without losing the row's place: stateScope is made once, when the key first appears, and lives until the key is gone; widgetScope comes and goes with whether the row is realized. A non-virtualized ForEach/Table (below its Virtualization::threshold, or on a backend that never dewindows a row) always has widgetScope set alongside stateScope, so this costs nothing when windowing never applies.

Definition at line 70 of file mount.hpp.

Member Data Documentation

◆ key

Key morph::ui::detail::KeyedRow::key

The row's key.

Definition at line 72 of file mount.hpp.

◆ stateScope

std::unique_ptr<reactive::Scope> morph::ui::detail::KeyedRow::stateScope

Owns the row's slot; made once, for as long as the key is in the data.

Definition at line 74 of file mount.hpp.

◆ slot

RowSlot* morph::ui::detail::KeyedRow::slot = nullptr

The row's slot, owned by stateScope.

Definition at line 76 of file mount.hpp.

◆ widgetScope

std::unique_ptr<reactive::Scope> morph::ui::detail::KeyedRow::widgetScope

Owns the row's widget and its bindings; null while the row is dewindowed or has no view.

Definition at line 78 of file mount.hpp.

◆ widget

Widget* morph::ui::detail::KeyedRow::widget = nullptr

The row's widget, owned by widgetScope; null exactly when widgetScope is null.

Definition at line 80 of file mount.hpp.

◆ widgetState

RowWidgetState morph::ui::detail::KeyedRow::widgetState = RowWidgetState::NullView

Which of the three states above widget is in.

Definition at line 82 of file mount.hpp.

◆ viewPosition

std::size_t morph::ui::detail::KeyedRow::viewPosition = 0

This row's position in view order, as of the most recent reconcile pass – not its position in KeyedRows::list, which reorder groups realized rows ahead of dewindowed ones within (so the container only ever holds the widgets that exist), and so no longer matches view order once any row is dewindowed. applyWindow compares this against the visible range; reconcile is the only writer.

Definition at line 87 of file mount.hpp.


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