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

Move-only scoped disconnect token; never owns a tree or widget. Disconnect/destruction may run on any thread. It prevents future callback admission; an already admitted callback finishes on UI. Captures are reclaimed on UI at the next collecting UI operation or router destruction. Tokens may safely outlive the router. More...

#include <action.hpp>

Public Member Functions

 ActionBinding ()=default
 Empty disconnected token.
 ~ActionBinding ()
 Disconnect without invoking user code.
 ActionBinding (ActionBinding &&other) noexcept
 Transfer disconnect responsibility.
ActionBinding & operator= (ActionBinding &&other) noexcept
 Disconnect old registration, then transfer.
 ActionBinding (const ActionBinding &)=delete
ActionBinding & operator= (const ActionBinding &)=delete
void disconnect () noexcept
 Idempotent; active calls retain their captures until return.

Friends

class EventRouter
struct detail::EventRouterAccess

Detailed Description

Move-only scoped disconnect token; never owns a tree or widget. Disconnect/destruction may run on any thread. It prevents future callback admission; an already admitted callback finishes on UI. Captures are reclaimed on UI at the next collecting UI operation or router destruction. Tokens may safely outlive the router.

Constructor & Destructor Documentation

◆ ActionBinding()

portals::ActionBinding::ActionBinding ( ActionBinding && other)
noexcept

Transfer disconnect responsibility.

Parameters
otherToken to empty and transfer into this token; valid on any thread.

Member Function Documentation

◆ operator=()

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

Disconnect old registration, then transfer.

Parameters
otherToken to empty and transfer after disconnecting this registration; self-assignment is a no-op.
Returns
This token after the transfer.

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