Owning cold model declaration; copies share one single-scene registration. Construction does not read providers or register runtime objects. Closed declarations remain closed; use a new declaration for another scene. Captured borrows retain their original lifetime obligations. Access and registration are creating-UI-thread operations.
More...
#include <ui_model.hpp>
|
|
using | Row = T |
| | Immutable domain row, shared with the mounted model.
|
|
|
| Model ()=default |
| | Create an empty descriptor whose checked use reports INVALID_ARGUMENT.
|
| std::expected< ManagedModel< T >, ManagedError > | managed () const |
| | Obtain the published model without extending scene lifetime.
|
| ModelValue< T > | value (std::source_location origin=std::source_location::current()) const |
| | Observe this scalar value; descriptor assignment itself only copies handles.
|
template<class Member, class Record>
requires std::same_as<Record, T> && std::equality_comparable<T> && std::copy_constructible<T> && std::copy_constructible
<std::remove_cv_t<Member>> && (!std::is_array_v<Member>) && (!std::is_pointer_v<Member>) &&
(!portals::detail::IS_BORROWED_DERIVED_VALUE<std::remove_cv_t<Member>>) && (!std::ranges::view<std::remove_cv_t<Member>>) |
| ModelField< T, Member > | field (Member Record::*member, std::source_location origin=std::source_location::current()) const |
| | Observe one owned scalar field without borrowing a snapshot or registering another source.
|
| std::expected< void, ManagedError > | insert (std::uint64_t index, const T &value) const |
| | Insert one value into a mounted owned sequence on its UI thread.
|
| std::expected< void, ManagedError > | update (RowId id, const T &value) const |
| | Replace one owned row value while preserving its model-local identity and order.
|
| bool | row (RowId id, const T &value, std::source_location origin=std::source_location::current()) const |
| | Replace an owned row value and collect a checked failure in the existing event diagnostics.
|
| std::expected< void, ManagedError > | erase (std::uint64_t first, std::uint64_t count=1) const |
| | Erase a range from a mounted owned sequence on its UI thread.
|
| std::expected< void, ManagedError > | move (std::uint64_t first, std::uint64_t count, std::uint64_t destination) const |
| | Move an owned range without replacing its row identities.
|
| std::expected< void, ManagedError > | clear () const |
| | Remove every row from a mounted owned sequence on its UI thread.
|
|
|
struct | detail::ModelAccess |
|
struct | detail::EditAccess |
|
struct | detail::ValueModelAccess |
|
template<class> |
| class | ModelValue |
|
template<class, class> |
| class | ModelField |
template<class T>
class portals::ui::Model< T >
Owning cold model declaration; copies share one single-scene registration. Construction does not read providers or register runtime objects. Closed declarations remain closed; use a new declaration for another scene. Captured borrows retain their original lifetime obligations. Access and registration are creating-UI-thread operations.
- Template Parameters
-
| T | Domain value or collection row; scalar and owned-array paths require copyable values. |
◆ clear()
Remove every row from a mounted owned sequence on its UI thread.
- Returns
- Success or typed capability, lifetime or allocation failure; rejection preserves the snapshot. An already empty sequence does not advance its revision.
◆ erase()
Erase a range from a mounted owned sequence on its UI thread.
- Parameters
-
| first | Range start; the end boundary is valid for an empty range. |
| count | Erased count, defaulting to one; zero is a no-op. |
- Returns
- Success or typed capability, lifetime, bounds or allocation failure; rejection preserves the snapshot.
◆ field()
template<class T>
requires std::same_as<Record, T> && std::equality_comparable<T> && std::copy_constructible<T> && std::copy_constructible
<std::remove_cv_t<Member>> && (!std::is_array_v<Member>) && (!std::is_pointer_v<Member>) &&
(!portals::detail::IS_BORROWED_DERIVED_VALUE<std::remove_cv_t<Member>>) && (!std::ranges::view<std::remove_cv_t<Member>>)
template<class Member, class Record>
requires std::same_as<Record, T> && std::equality_comparable<T> && std::copy_constructible<T> && std::copy_constructible
<std::remove_cv_t<Member>> && (!std::is_array_v<Member>) && (!std::is_pointer_v<Member>) &&
(!portals::detail::IS_BORROWED_DERIVED_VALUE<std::remove_cv_t<Member>>) && (!std::ranges::view<std::remove_cv_t<Member>>)
| ModelField< T, Member > portals::ui::Model< T >::field |
( |
Member Record::* | member, |
|
|
std::source_location | origin = std::source_location::current() ) const |
Observe one owned scalar field without borrowing a snapshot or registering another source.
- Template Parameters
-
| Member | Copyable owning field value; const fields expose checked reads only. Known borrowed pointers, string views, spans, reference wrappers and range views are rejected. |
| Record | Declaring record type, required to match this model's value type. |
- Parameters
-
| member | Non-null data-member pointer retained by value; null reports INVALID_ARGUMENT on use. |
| origin | Assignment diagnostic site retained by the returned proxy. |
- Returns
- UI-affine field property sharing this declaration and its root revision/transaction. Cold, collection, wrong-thread and closed failures follow value().
◆ insert()
Insert one value into a mounted owned sequence on its UI thread.
- Parameters
-
| index | Insertion ordinal, including the end boundary. |
| value | Value copied under the existing mutation admission boundary. |
- Returns
- Success with a fresh SDK identity, or typed capability, lifetime, capacity or allocation failure. Existing identities survive; failure preserves the installed snapshot.
◆ managed()
Obtain the published model without extending scene lifetime.
- Returns
- Weak runtime handle, CLOSED before publication/after close, or a typed handle/thread failure.
◆ move()
Move an owned range without replacing its row identities.
- Parameters
-
| first | Moved range start. |
| count | Moved row count; zero is a no-op. |
| destination | Insertion index after removing the range. |
- Returns
- Success or typed capability, lifetime, bounds or allocation failure; rejection preserves the snapshot.
◆ row()
template<class T>
| bool portals::ui::Model< T >::row |
( |
RowId | id, |
|
|
const T & | value, |
|
|
std::source_location | origin = std::source_location::current() ) const |
Replace an owned row value and collect a checked failure in the existing event diagnostics.
- Parameters
-
| id | Exact model-local row key, with the same validation as update(). |
| value | Replacement copied under update() admission. |
| origin | Caller location retained by collected diagnostics. |
- Returns
- True on acceptance or equality no-op; false after reporting the update() failure.
◆ update()
Replace one owned row value while preserving its model-local identity and order.
- Parameters
-
| id | Exact live key from this model; missing or stale generations report INVALID_ARGUMENT. |
| value | Copy-constructible replacement, copied before publication; no assignment is required. |
- Returns
- Success or typed capability, lifetime, reentry, key, revision or allocation failure. Equality-comparable values that compare equal are a no-op; other values publish a revision. Precommit failure preserves the snapshot. Later delivery errors do not roll back an accepted update.
◆ value()
template<class T>
requires std::equality_comparable<T>
| ModelValue< T > portals::ui::Model< T >::value |
( |
std::source_location | origin = std::source_location::current() | ) |
const |
Observe this scalar value; descriptor assignment itself only copies handles.
- Parameters
-
| origin | Assignment diagnostic site retained by the returned proxy. |
- Returns
- UI-affine smart property with checked reads/writes and collected assignment. Collection declarations report INVALID_ARGUMENT; cold or closed values report CLOSED.
The documentation for this class was generated from the following files: