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

Tree-scoped source using only existing scheduler queues; no total/origin/runtime is required. More...

#include <window_source.hpp>

Public Member Functions

 ~WindowSource ()
 Close on UI without joining workers.
 WindowSource (const WindowSource &)=delete
WindowSource & operator= (const WindowSource &)=delete
SourceStamp stamp () const noexcept
std::expected< std::uint64_t, SourceError > dataRevision () const
std::shared_ptr< SourceBudget > budget () const noexcept
SourceCapabilities capabilities () const noexcept
std::expected< WindowConsumer< T >, SourceError > openConsumer ()
WindowNotifier< T > notifier () const noexcept
std::expected< PublishResult, SourceError > notifyReady (SourceStamp source, std::uint64_t revision) const
void close () noexcept
 Retire admission/delivery on UI; old immutable owners remain charged until final release.

Static Public Member Functions

static std::expected< std::unique_ptr< WindowSource >, SourceError > create (WidgetTree &tree, Node< Widget > context, std::shared_ptr< WindowProvider< T > > provider, WindowSourceOptions options={}, std::shared_ptr< SourceBudget > budget={})

Detailed Description

template<class T>
class portals::WindowSource< T >

Tree-scoped source using only existing scheduler queues; no total/origin/runtime is required.

Template Parameters
TImmutable row value with worker-safe final destruction and accounted dynamic page payload.

Member Function Documentation

◆ budget()

template<class T>
std::shared_ptr< SourceBudget > portals::WindowSource< T >::budget ( ) const
inlinenoexcept
Returns
Shared credit root for related sources/replacements.

◆ capabilities()

template<class T>
SourceCapabilities portals::WindowSource< T >::capabilities ( ) const
inlinenoexcept
Returns
Captured immutable capabilities.

◆ create()

template<class T>
std::expected< std::unique_ptr< WindowSource >, SourceError > portals::WindowSource< T >::create ( WidgetTree & tree,
Node< Widget > context,
std::shared_ptr< WindowProvider< T > > provider,
WindowSourceOptions options = {},
std::shared_ptr< SourceBudget > budget = {} )
inlinestatic
Parameters
treeUI tree; node scope retirement is checked before every later raw-tree access.
contextNode controlling delivery lifetime and frame admission.
providerWorker-safe provider; external provider/domain storage is outside page accounting.
optionsPositive page/work limits.
budgetShared root; pass the old root for replacement sessions, null creates a default root.
Returns
New immutable session, or typed setup/allocation/capability failure.

◆ dataRevision()

template<class T>
std::expected< std::uint64_t, SourceError > portals::WindowSource< T >::dataRevision ( ) const
inline
Returns
Latest applied readiness/data revision, WRONG_THREAD, or CLOSED. Reading the scalar on UI performs no provider work or I/O. Queued notifications become visible only after the existing scheduler applies them.

◆ notifier()

template<class T>
WindowNotifier< T > portals::WindowSource< T >::notifier ( ) const
inlinenoexcept
Returns
Worker-safe readiness endpoint; obtain on UI before dispatch, safe after source destruction.

◆ notifyReady()

template<class T>
std::expected< PublishResult, SourceError > portals::WindowSource< T >::notifyReady ( SourceStamp source,
std::uint64_t revision ) const
inline
Parameters
sourceExact immutable session stamp.
revisionStrictly newer readiness/data revision.
Returns
Queue admission only; use notifier() when a worker may outlive this object.

◆ openConsumer()

template<class T>
std::expected< WindowConsumer< T >, SourceError > portals::WindowSource< T >::openConsumer ( )
inline
Returns
Independent UI consumer or a capacity/context error.

◆ stamp()

template<class T>
SourceStamp portals::WindowSource< T >::stamp ( ) const
inlinenoexcept
Returns
Immutable session identity, safe to copy on UI.

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