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

Read-only finite model navigation without retaining the source or any row payload. Snapshot ownership remains with the model/application. Each call temporarily locks the weak snapshot, returning CLOSED after its last owner retires. Calls may run concurrently only when the snapshot's read/index implementation is worker-safe. locateRow must be a bounded index. No fallback scans or ordinal guessing are used. For UI use, keep change proofs small; large configurable proofs run on the existing worker path. This adapter neither schedules work nor subscribes to model updates. More...

#include <model_position_finite.hpp>

Inheritance diagram for portals::FinitePositionResolver< T >:
portals::FinitePositionResolver< T >portals::FinitePositionResolver< T > portals::PositionResolver

Public Member Functions

std::expected< ModelBookmark, SourceError > capture (std::uint64_t index, PositionAffinity affinity=PositionAffinity::FORWARD, BookmarkOptions options={}) const
std::expected< PositionReply, SourceError > resolve (const PositionRequest &request, std::stop_token stop={}) const override
Public Member Functions inherited from portals::PositionResolver
virtual ~PositionResolver ()=default
 Release only the resolver's own bounded metadata.

Static Public Member Functions

static std::expected< FinitePositionResolver, SourceError > create (ModelResource resource, SourceStamp session, std::shared_ptr< const ModelSnapshot< T > > snapshot, PositionChangeMap changes={})

Detailed Description

template<class T>
class portals::FinitePositionResolver< T >

Read-only finite model navigation without retaining the source or any row payload. Snapshot ownership remains with the model/application. Each call temporarily locks the weak snapshot, returning CLOSED after its last owner retires. Calls may run concurrently only when the snapshot's read/index implementation is worker-safe. locateRow must be a bounded index. No fallback scans or ordinal guessing are used. For UI use, keep change proofs small; large configurable proofs run on the existing worker path. This adapter neither schedules work nor subscribes to model updates.

Template Parameters
TImmutable domain row type; no domain values are copied.

Member Function Documentation

◆ capture()

template<class T>
std::expected< ModelBookmark, SourceError > portals::FinitePositionResolver< T >::capture ( std::uint64_t index,
PositionAffinity affinity = PositionAffinity::FORWARD,
BookmarkOptions options = {} ) const
inline
Parameters
indexOne current finite row to capture; reads exactly one row, without scanning.
affinityPreferred neighbor after a later deletion.
optionsMetadata capacity for the resulting bookmark.
Returns
Owning bookmark; WOULD_BLOCK for pending data, CLOSED, or typed provider failure.

◆ create()

template<class T>
std::expected< FinitePositionResolver, SourceError > portals::FinitePositionResolver< T >::create ( ModelResource resource,
SourceStamp session,
std::shared_ptr< const ModelSnapshot< T > > snapshot,
PositionChangeMap changes = {} )
inlinestatic
Parameters
resourceLogical resource stable across compatible snapshots.
sessionExisting current delivery session, qualified on every resolve.
snapshotNon-null immutable finite snapshot, stored weakly.
changesOptional complete ordering proof ending in snapshot->revision().
Returns
Resolver, or INVALID_ARGUMENT for inconsistent identity/map metadata.

◆ resolve()

template<class T>
std::expected< PositionReply, SourceError > portals::FinitePositionResolver< T >::resolve ( const PositionRequest & request,
std::stop_token stop = {} ) const
inlineoverridevirtual
Parameters
requestBookmark plus current delivery session/revision/request generation.
stopCooperative cancellation checked before and after provider calls.
Returns
Qualified EXACT/NEAREST/EMPTY/PENDING/UNSUPPORTED/INCOMPATIBLE receipt or typed error. The model, bookmark and caller's current/selection/viewport are never modified.

Implements portals::PositionResolver.


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