5#include <portals/model.hpp>
50 return std::addressof(row_->value);
62 auto previous = *
this;
75 friend class VisibleModelSnapshot;
88 : owner_(std::move(other.owner_)), rows_(std::exchange(other.rows_, {})),
89 interval_(std::exchange(other.interval_, {})) {
96 std::swap(owner_, other.owner_);
97 std::swap(rows_, other.rows_);
98 std::swap(interval_, other.interval_);
110 return Iterator(rows_.empty() ? rows_.data() : rows_.data() + rows_.size());
114 std::size_t
size() const noexcept {
120 return rows_.empty();
124 std::span<const ModelRow<T>>
rows() const noexcept {
135 return owner_.dataRevision();
142 : owner_(std::move(owner)), rows_(
rows), interval_(interval) {
145 ModelRange<T> owner_;
146 std::span<const ModelRow<T>> rows_;
Independent owner for borrowed rows and provider error text.
Definition model.hpp:175
One UI-owned table with bounded owning cell text and one independent model consumer....
Definition virtual_table.hpp:154
Standard forward iterator projecting each immutable row to its domain value.
Definition visible_model.hpp:34
Iterator()=default
Empty iterator; do not dereference it.
const T & operator*() const noexcept
Definition visible_model.hpp:44
Iterator & operator++() noexcept
Definition visible_model.hpp:54
std::ptrdiff_t difference_type
Standard signed distance type.
Definition visible_model.hpp:37
std::forward_iterator_tag iterator_concept
Multipass immutable traversal.
Definition visible_model.hpp:38
bool operator==(const Iterator &other) const noexcept=default
T value_type
Standard iterator value type.
Definition visible_model.hpp:36
const T * operator->() const noexcept
Definition visible_model.hpp:49
std::forward_iterator_tag iterator_category
Legacy algorithm category.
Definition visible_model.hpp:39
Iterator operator++(int) noexcept
Definition visible_model.hpp:61
VisibleModelSnapshot()=default
Successful empty value with no provider storage.
std::uint64_t dataRevision() const noexcept
Definition visible_model.hpp:134
VisibleModelSnapshot(VisibleModelSnapshot &&other) noexcept
Definition visible_model.hpp:87
VisibleModelSnapshot & operator=(VisibleModelSnapshot other) noexcept
Definition visible_model.hpp:95
Iterator begin() const noexcept
Definition visible_model.hpp:104
RowRange range() const noexcept
Definition visible_model.hpp:129
std::span< const ModelRow< T > > rows() const noexcept
Definition visible_model.hpp:124
std::size_t size() const noexcept
Definition visible_model.hpp:114
bool empty() const noexcept
Definition visible_model.hpp:119
Iterator end() const noexcept
Definition visible_model.hpp:109
VisibleModelSnapshot(const VisibleModelSnapshot &)=default
Share immutable storage without copying values.
Public Portals API.
Definition action.hpp:8
@ PENDING
Complete or abandon the owning session before submitting another frame.
Definition diff.hpp:108
VisibleModelReadState
A view has not published ready physical rows; no case denotes successful emptiness.
Definition visible_model.hpp:11
@ NOT_PREPARED
No current preparation, including after scroll or configuration changes.
Definition visible_model.hpp:12
@ FAILED
The coroutine returned an error or threw.
Definition async.hpp:46
A typed domain row and its stable identity; a table uses a typed record as T.
Definition model.hpp:55
Half-open logical row interval; arithmetic is checked before provider access.
Definition model.hpp:35
Owning preparation/provider failure, independent of the table and provider lifetime.
Definition visible_model.hpp:18
VisibleModelReadState state
Explicit preparation or provider failure.
Definition visible_model.hpp:19
std::string message
Owning provider description for FAILED; otherwise empty.
Definition visible_model.hpp:20