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

Immutable owning rows with explicit provider identity and bounded identity lookup. More...

#include <collection.hpp>

Public Member Functions

 ~RowCollection ()=default
 Release shared row ownership; transferring this value retains a valid shared-owner source.
std::span< const ModelRow< T > > rows () const noexcept
RowLookup locate (RowId id) const noexcept
bool operator== (const RowCollection &other) const

Static Public Member Functions

static std::expected< RowCollection, TreeError > from (std::span< const ModelRow< T > > rows, CollectionLimits limits={})
 Copy a checked whole collection into private immutable storage.

Detailed Description

template<class T>
requires std::copy_constructible<T> && std::equality_comparable<T>
class portals::RowCollection< T >

Immutable owning rows with explicit provider identity and bounded identity lookup.

Template Parameters
TCopy-constructible equality-comparable transitively owning domain value; published aliases stay immutable. Copies share one const payload. Existing Model providers do not acquire these copying/equality requirements.

Member Function Documentation

◆ from()

template<class T>
std::expected< RowCollection, TreeError > portals::RowCollection< T >::from ( std::span< const ModelRow< T > > rows,
CollectionLimits limits = {} )
inlinestatic

Copy a checked whole collection into private immutable storage.

Parameters
rowsValues borrowed only during construction; all RowId components must be nonzero and pairs unique.
limitsPositive count cap; domain payload byte bounds remain the source's responsibility.
Returns
Independent row storage or INVALID_ARGUMENT, NODE_LIMIT, NO_MEMORY or CALLBACK_FAILED.

◆ locate()

template<class T>
RowLookup portals::RowCollection< T >::locate ( RowId id) const
inlinenoexcept
Parameters
idFull provider identity to locate.
Returns
FOUND with the original ordinal, otherwise NOT_FOUND; no allocation or full row scan.

◆ operator==()

template<class T>
bool portals::RowCollection< T >::operator== ( const RowCollection< T > & other) const
inline
Parameters
otherOwning rows to compare.
Returns
Equal ordered IDs and values; T comparison exceptions propagate to the receiving checked operation.

◆ rows()

template<class T>
std::span< const ModelRow< T > > portals::RowCollection< T >::rows ( ) const
inlinenoexcept
Returns
Borrowed immutable rows; retain this value or its snapshot throughout use.

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