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

UI-owned scope disconnecting all its subscriptions and timers, in any token order. Owned callback captures survive self-close until the active dispatch returns. Arbitrary reference captures remain the caller's responsibility. Release before Scheduler. More...

#include <scheduler.hpp>

Public Member Functions

 UiScope ()=default
 Empty closed scope.
 ~UiScope ()
 Close on UI; wrong-thread destruction terminates.
 UiScope (UiScope &&other) noexcept
 Transfer scope on UI.
UiScope & operator= (UiScope &&other) noexcept
 Close old scope, then transfer.
 UiScope (const UiScope &)=delete
UiScope & operator= (const UiScope &)=delete
std::expected< void, SchedulerError > close ()
 UI-only, idempotent; no worker join.

Friends

class Scheduler

Detailed Description

UI-owned scope disconnecting all its subscriptions and timers, in any token order. Owned callback captures survive self-close until the active dispatch returns. Arbitrary reference captures remain the caller's responsibility. Release before Scheduler.

Constructor & Destructor Documentation

◆ UiScope()

portals::UiScope::UiScope ( UiScope && other)
noexcept

Transfer scope on UI.

Parameters
otherUI-owned token to empty and transfer into this token.

Member Function Documentation

◆ close()

std::expected< void, SchedulerError > portals::UiScope::close ( )

UI-only, idempotent; no worker join.

Returns
Success after logical closure, including an empty scope; WRONG_THREAD leaves a live scope unchanged.

◆ operator=()

UiScope & portals::UiScope::operator= ( UiScope && other)
noexcept

Close old scope, then transfer.

Parameters
otherUI-owned token to empty and transfer; self-assignment is a no-op.
Returns
This token after replacing its previous ownership.

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