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

Exclusive ready-only transport borrowed by an application session. Every operation must return without waiting for I/O, a timer or another callback. Operations perform bounded work; poll returns one owning batch respecting TerminalOptions limits. DEADLINE with no error means no input/progress is currently available. Errors remain explicit. submit transfers a complete encoded batch into bounded owned storage, without acknowledging output. flushReady reports exact newly accepted bytes and the retained suffix, using FrameOutput accounting. Acceptance into a bounded host queue may count as progress; physical display is not promised. close must also be nonblocking, idempotent and noexcept. The transport must outlive cleanup, including Application destruction when a session is still active. Calls run on the UI owner thread. More...

#include <application.hpp>

Public Member Functions

virtual ~ApplicationReadyTerminal ()=default
 Destroy after session cleanup.
virtual PointerCaptureCapabilities pointerCaptureCapabilities () const noexcept
virtual TerminalRead poll (std::stop_token stop)=0
virtual std::expected< void, TerminalError > protocol (const InputProtocolEvent &report)
virtual std::expected< void, TerminalError > pointerMetrics (bool usable)
virtual std::expected< CellSize, TerminalError > size () const =0
virtual std::expected< void, TerminalError > submit (std::string bytes)=0
virtual TerminalWrite flushReady (std::stop_token stop)=0
virtual std::expected< void, TerminalError > close () noexcept=0

Detailed Description

Exclusive ready-only transport borrowed by an application session. Every operation must return without waiting for I/O, a timer or another callback. Operations perform bounded work; poll returns one owning batch respecting TerminalOptions limits. DEADLINE with no error means no input/progress is currently available. Errors remain explicit. submit transfers a complete encoded batch into bounded owned storage, without acknowledging output. flushReady reports exact newly accepted bytes and the retained suffix, using FrameOutput accounting. Acceptance into a bounded host queue may count as progress; physical display is not promised. close must also be nonblocking, idempotent and noexcept. The transport must outlive cleanup, including Application destruction when a session is still active. Calls run on the UI owner thread.

Member Function Documentation

◆ close()

virtual std::expected< void, TerminalError > portals::ApplicationReadyTerminal::close ( )
pure virtualnoexcept
Returns
Success or original cleanup error; no waiting or exceptions.

◆ flushReady()

virtual TerminalWrite portals::ApplicationReadyTerminal::flushReady ( std::stop_token stop)
pure virtual
Parameters
stopCooperative cancellation signal.
Returns
Exact progress from bounded ready output work and the remaining owned suffix.

◆ pointerCaptureCapabilities()

virtual PointerCaptureCapabilities portals::ApplicationReadyTerminal::pointerCaptureCapabilities ( ) const
virtualnoexcept
Returns
Host motion/release guarantees; default is no pointer capture. The host must cancel lost sequences explicitly. No I/O or allocation is performed by the default.

◆ pointerMetrics()

virtual std::expected< void, TerminalError > portals::ApplicationReadyTerminal::pointerMetrics ( bool usable)
virtual
Parameters
usableWhether current pixel dimensions are valid for the viewport.
Returns
Success or a host transition error; default requests no work and performs no I/O.

◆ poll()

virtual TerminalRead portals::ApplicationReadyTerminal::poll ( std::stop_token stop)
pure virtual
Parameters
stopCooperative cancellation signal; never wait for cancellation.
Returns
One ready owning input batch, no input, EOF, stop, or an explicit error.

◆ protocol()

virtual std::expected< void, TerminalError > portals::ApplicationReadyTerminal::protocol ( const InputProtocolEvent & report)
virtual
Parameters
reportOrdered owning protocol report.
Returns
Success or a host transition error; default ignores the report without I/O.

◆ size()

virtual std::expected< CellSize, TerminalError > portals::ApplicationReadyTerminal::size ( ) const
pure virtual
Returns
Current nonnegative viewport, or its original error, without waiting.

◆ submit()

virtual std::expected< void, TerminalError > portals::ApplicationReadyTerminal::submit ( std::string bytes)
pure virtual
Parameters
bytesComplete owning transaction; reject before output if it cannot be retained.
Returns
Success after retaining bytes, or the original transport rejection.

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