Portals 0.7.0 · dev0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::ModelSnapshot< T > Class Template Referenceabstract
Immutable list/table provider storage, independent of view/source lifetime. Implement read as bounded in-memory access, without I/O, waiting or domain mutation. Every ready range of one data revision must agree, including overlapping ranges from different snapshot objects. Shared ownership does not make mutable aliases safe. Opting this source into a background model adapter requires worker-safe read access, including concurrent reads of the same immutable storage; no UI frame or thread-affine cache may be used. Snapshots and transitively owned T values must support destruction on the last owner's thread; UI reentry from a destructor requires a still-live UI context.
More...
Optional immutable ordering proof owner; default sources add no storage.
Detailed Description
template<class T>
class portals::ModelSnapshot< T >
Immutable list/table provider storage, independent of view/source lifetime. Implement read as bounded in-memory access, without I/O, waiting or domain mutation. Every ready range of one data revision must agree, including overlapping ranges from different snapshot objects. Shared ownership does not make mutable aliases safe. Opting this source into a background model adapter requires worker-safe read access, including concurrent reads of the same immutable storage; no UI frame or thread-affine cache may be used. Snapshots and transitively owned T values must support destruction on the last owner's thread; UI reentry from a destructor requires a still-live UI context.
Template Parameters
T
Domain row value type; snapshot-owned reachable data must remain immutable and support destruction on the final owner's thread. Library range/frame/request operations do not copy T values.
Resolve stable identity without materializing rows or blocking the UI.
Parameters
id
Full nonzero row identity, including generation.
Returns
FOUND with this snapshot's index, NOT_FOUND if absent, or UNSUPPORTED by default.
Note
Override with a bounded identity index to support stable viewport anchoring and ensure-visible. Do not scan the full model, perform I/O, mutate domain data, or retain the argument. Called during preparation on UI, never paint; exceptions are translated by ModelFrame::locateRow.
Optional immutable ordering proof owner; default sources add no storage.
Returns
Provider-owned bounded scalar history, or empty when this capability is unsupported. This additive virtual capability requires matching SDK headers and library ABI.
Borrow a checked interval; may return pending/error.
Parameters
range
Interval already validated by ModelRange::read; direct callers must validate bounds.
Returns
Borrowed rows/error text owned by this snapshot: ready has exactly range.count rows and no error; pending has no rows or error; error has no rows. The provider must keep returned storage alive.