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

Weak exact-record factory/action context; it never follows a recycled position. More...

#include <ui_virtual_rows.hpp>

Public Member Functions

 RowContext ()=default
 Empty weak row handle; checked operations report CLOSED.
RowId id () const noexcept
const T & value () const
template<class Value, class Record>
requires std::same_as<T, Record>
RowField< T, Value > field (Value Record::*member) const
template<class Value, class Record>
requires std::same_as<T, Record>
RowField< T, Value > field (std::string_view key, Value Record::*member, std::type_identity_t< std::shared_ptr< EditEndpoint< Value > > > endpoint) const
std::expected< RowSnapshot< T >, TreeError > snapshot () const
std::expected< void, TreeError > commit () const
std::expected< void, TreeError > cancel () const
std::expected< bool, TreeError > applyReply (const EditReceipt &receipt) const
std::expected< void, TreeError > admitEdit () const
std::expected< void, TreeError > participate (std::shared_ptr< VirtualRowEditParticipant > participant) const
std::expected< void, TreeError > erase () const

Detailed Description

template<class T>
class portals::ui::RowContext< T >

Weak exact-record factory/action context; it never follows a recycled position.

Template Parameters
TImmutable domain row type. Saved handles close when their assignment retires.

Member Function Documentation

◆ admitEdit()

template<class T>
std::expected< void, TreeError > portals::ui::RowContext< T >::admitEdit ( ) const
inline
Returns
Pre-mutation admission for a custom editor's unfinished state, sharing the one-row pin budget.

◆ applyReply()

template<class T>
std::expected< bool, TreeError > portals::ui::RowContext< T >::applyReply ( const EditReceipt & receipt) const
inline
Parameters
receiptOriginal exact-target backend acknowledgement, delivered through the existing UI path.
Returns
True when applied, false after retirement/stale completion, or a checked thread/protocol failure.

◆ cancel()

template<class T>
std::expected< void, TreeError > portals::ui::RowContext< T >::cancel ( ) const
inline
Returns
Checked cancellation of this row's local drafts; admitted backend work remains admitted.

◆ commit()

template<class T>
std::expected< void, TreeError > portals::ui::RowContext< T >::commit ( ) const
inline
Returns
Checked commit of this row's retained fields through the existing edit session.

◆ erase()

template<class T>
std::expected< void, TreeError > portals::ui::RowContext< T >::erase ( ) const
inline
Returns
Exact-record erase admission, or CLOSED/unsupported/missing-target failure.

◆ field() [1/2]

template<class T>
template<class Value, class Record>
requires std::same_as<T, Record>
RowField< T, Value > portals::ui::RowContext< T >::field ( std::string_view key,
Value Record::* member,
std::type_identity_t< std::shared_ptr< EditEndpoint< Value > > > endpoint ) const
inline
Template Parameters
ValueOwning supported field type.
Parameters
keyPersistent schema field key.
memberSelected field.
endpointExisting exact-target backend write/read capability.
Returns
Weak field capability using the same edit protocol as finite models.

◆ field() [2/2]

template<class T>
template<class Value, class Record>
requires std::same_as<T, Record>
RowField< T, Value > portals::ui::RowContext< T >::field ( Value Record::* member) const
inline
Template Parameters
ValueOwning field value.
Parameters
memberNon-null data member pointer.
Returns
Existing fixed-target edit field, using the shared edit/history/validation engine.

◆ id()

template<class T>
RowId portals::ui::RowContext< T >::id ( ) const
inlinenoexcept
Returns
Complete row identity copied from the assignment, or zero after retirement.

◆ participate()

template<class T>
std::expected< void, TreeError > portals::ui::RowContext< T >::participate ( std::shared_ptr< VirtualRowEditParticipant > participant) const
inline
Parameters
participantTyped custom state, owning any unfinished draft/history/selection.
Returns
Bounded UI-affine registration, or checked lifetime/capacity/allocation failure. The custom control must call admitEdit before changing unfinished state.

◆ snapshot()

template<class T>
std::expected< RowSnapshot< T >, TreeError > portals::ui::RowContext< T >::snapshot ( ) const
inline
Returns
Checked owning data lease for later callback use; retired assignments return CLOSED.

◆ value()

template<class T>
const T & portals::ui::RowContext< T >::value ( ) const
inline
Returns
Factory-only borrowed immutable row, valid until the factory returns.
Exceptions
TreeErrorCLOSED after retirement; factory exceptions become checked mount failures.

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