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

Move-only weak cancellation token; owns no callback, widget, tree or router. Destruction/disconnect may run on any thread and prevents future admission. Already admitted delivery keeps its callable and widget alive until return. Tokens may outlive the router. Eligibility and focus retirement are checked on UI, without background polling. More...

#include <action.hpp>

Public Member Functions

 PointerCapture ()=default
 Construct an empty disconnected token.
 ~PointerCapture ()
 Disconnect without user callbacks or tree access, on any thread.
 PointerCapture (PointerCapture &&other) noexcept
 Transfer cancellation responsibility and empty the source.
PointerCapture & operator= (PointerCapture &&other) noexcept
 Disconnect the old token, then transfer; self-assignment is a no-op.
 PointerCapture (const PointerCapture &)=delete
PointerCapture & operator= (const PointerCapture &)=delete
void disconnect () noexcept
 Idempotently deny future admission, without cancelling an already admitted call.
bool connected () const noexcept
 Observe cancellation flags without consulting live UI/tree eligibility.

Friends

class EventRouter
struct detail::PointerCaptureAccess

Detailed Description

Move-only weak cancellation token; owns no callback, widget, tree or router. Destruction/disconnect may run on any thread and prevents future admission. Already admitted delivery keeps its callable and widget alive until return. Tokens may outlive the router. Eligibility and focus retirement are checked on UI, without background polling.

Constructor & Destructor Documentation

◆ PointerCapture()

portals::PointerCapture::PointerCapture ( PointerCapture && other)
noexcept

Transfer cancellation responsibility and empty the source.

Parameters
otherToken to transfer; any thread, without invoking callbacks.

Member Function Documentation

◆ connected()

bool portals::PointerCapture::connected ( ) const
nodiscardnoexcept

Observe cancellation flags without consulting live UI/tree eligibility.

Returns
True while capture and its action binding remain connected; false after disconnection, release or router retirement. Use EventRouter::pointerCapture for checked effective eligibility.
Note
Any thread; no allocation, callbacks, mutation or tree access.

◆ operator=()

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

Disconnect the old token, then transfer; self-assignment is a no-op.

Parameters
otherToken to empty and transfer.
Returns
This token; any thread, without callbacks or tree access.

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