Derived model snapshot with distinct projection revision and exact source provenance. Retains the source pin and provider result for every borrowed row. Construction does not validate the page; QueryController validates worker results before creating this wrapper.
More...
#include <model_query.hpp >
portals::QuerySnapshot< T > portals::QuerySnapshot< T >
QuerySnapshot (std::uint64_t projectionRevision, std::uint64_t sourceIdentity, std::uint64_t queryGeneration, std::shared_ptr< const ModelSnapshot < T > > source, QueryPage < T > result, RowRange page)
Retain immutable source and result owners under a new projection revision.
ModelRows < T > read (RowRange range) const override
Read only the already materialized page.
RowLookup locateRow (RowId id) const override
Resolve identity in the page-local result.
std::uint64_t sourceRevision () const noexcept
Original exact source revision.
std::uint64_t sourceIdentity () const noexcept
Fixed provider session identity.
std::uint64_t queryGeneration () const noexcept
Query generation represented by the page.
std::shared_ptr< const ModelSnapshot < T > > source () const noexcept
Original source owner.
std::uint64_t totalRows () const noexcept
Logical filtered result size before paging.
RowRange page () const noexcept
Query page in filtered-result coordinates.
ModelSnapshot (std::uint64_t revision, std::uint64_t rows)
Define immutable metadata.
virtual ~ModelSnapshot ()=default
Reclaim storage after all ranges, frames and workers release it.
std::uint64_t revision () const noexcept
Provider data revision; strictly increasing on replacement.
std::uint64_t rowCount () const noexcept
Logical count, without materializing rows.
virtual std::shared_ptr< const PositionChangeHistory > positionHistory () const
Optional immutable ordering proof owner; default sources add no storage.
template<class T>
class portals::QuerySnapshot< T >
Derived model snapshot with distinct projection revision and exact source provenance. Retains the source pin and provider result for every borrowed row. Construction does not validate the page; QueryController validates worker results before creating this wrapper.
Template Parameters
T Immutable domain row type satisfying ModelSnapshot<T>'s ownership contract.
◆ QuerySnapshot()
Retain immutable source and result owners under a new projection revision.
Parameters
projectionRevision Monotonic derived model revision; never a source revision.
sourceIdentity Nonzero fixed provider-session identity.
queryGeneration Accepted query generation; zero denotes the initial unqueried source.
source Exact immutable source pin, non-null.
result Exact-source page and total filtered row count, with non-null snapshot.
page Requested interval within the filtered/sorted source.
◆ locateRow()
Resolve identity in the page-local result.
Parameters
id Exact stable source identity and generation.
Returns Provider's bounded identity lookup capability and page-local index.
Reimplemented from portals::ModelSnapshot< T > .
◆ page()
Query page in filtered-result coordinates.
Returns Original requested page; model reads use page-local coordinates starting at zero.
◆ queryGeneration()
Query generation represented by the page.
Returns Accepted request generation, or zero for initial source data.
◆ read()
Read only the already materialized page.
Parameters
range Checked interval in page-local model coordinates, not source coordinates.
Returns Borrowed rows from the retained immutable result snapshot.
Implements portals::ModelSnapshot< T > .
◆ source()
Original source owner.
Returns Shared exact immutable source pin, safe to retain beyond controller lifetime.
◆ sourceIdentity()
Fixed provider session identity.
Returns Nonzero identity issued for this query controller.
◆ sourceRevision()
Original exact source revision.
Returns Source pin's revision; never the derived ModelSnapshot revision.
◆ totalRows()
Logical filtered result size before paging.
Returns Total rows reported by the provider and validated against source size.
The documentation for this class was generated from the following file: