Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::PositionChangeMap Class Reference

Immutable bounded provider proof between two revisions of a finite order. The provider must report all ordering changes truthfully; validation checks shape and arithmetic, not the contents of two snapshots. O(operation count), never O(rows). The operation cap is configurable. Large proofs belong on the existing worker path; constructing a map does not dispatch work or make a UI scan acceptable. More...

#include <model_position.hpp>

Public Member Functions

 PositionChangeMap ()=default
 No proof; does not allocate.
 operator bool () const noexcept
std::uint64_t fromRevision () const noexcept
std::uint64_t toRevision () const noexcept
std::uint64_t afterCount () const noexcept
std::expected< PositionMapping, SourceError > map (ModelPosition position) const noexcept

Static Public Member Functions

static std::expected< PositionChangeMap, SourceError > create (std::uint64_t fromRevision, std::uint64_t toRevision, std::uint64_t beforeCount, std::span< const PositionChange > changes, PositionMapOptions options={})

Detailed Description

Immutable bounded provider proof between two revisions of a finite order. The provider must report all ordering changes truthfully; validation checks shape and arithmetic, not the contents of two snapshots. O(operation count), never O(rows). The operation cap is configurable. Large proofs belong on the existing worker path; constructing a map does not dispatch work or make a UI scan acceptable.

Member Function Documentation

◆ afterCount()

std::uint64_t portals::PositionChangeMap::afterCount ( ) const
noexcept
Returns
Target finite row count, or zero for no proof.

◆ create()

std::expected< PositionChangeMap, SourceError > portals::PositionChangeMap::create ( std::uint64_t fromRevision,
std::uint64_t toRevision,
std::uint64_t beforeCount,
std::span< const PositionChange > changes,
PositionMapOptions options = {} )
static
Parameters
fromRevisionPositive revision in which positions were captured.
toRevisionStrictly newer target revision.
beforeCountRow count in fromRevision; metadata only.
changesComplete ordered splices/moves, copied before success.
optionsMaximum retained operation count.
Returns
Validated immutable proof, INVALID_ARGUMENT, WOULD_BLOCK or NO_MEMORY.

◆ fromRevision()

std::uint64_t portals::PositionChangeMap::fromRevision ( ) const
noexcept
Returns
Original revision, or zero for no proof.

◆ map()

std::expected< PositionMapping, SourceError > portals::PositionChangeMap::map ( ModelPosition position) const
noexcept
Parameters
positionItem/gap captured in fromRevision.
Returns
Mapped ordinal/gap, or INVALID_ARGUMENT/UNSUPPORTED/REVISION_CHANGED.

◆ operator bool()

portals::PositionChangeMap::operator bool ( ) const
explicitnoexcept
Returns
True when this value contains a declared revision mapping.

◆ toRevision()

std::uint64_t portals::PositionChangeMap::toRevision ( ) const
noexcept
Returns
Target revision, or zero for no proof.

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