holoscan::Input
Declare one typed sample input as a stable Operator member.
Runtime late-binds the declaration for an activation; the authoring object owns no queue or backend endpoint. All accessors use the same deterministic error precedence: unbound, stale, closed, not selected, cardinality mismatch, empty, then backend failure.
Template parameters
Inherits from: holoscan::InputBase (public)
Constructors
Input
Default
Overload 2
Construct an unnamed unbound input declaration.
Destructor
~Input
Destroy this stable input declaration after all runtime bindings have retired.
Methods
selection
Return the frozen selection status for the current activation.
The declaration is inspected only during its Operator callback.
Returns: Status recorded by the selector, or absent/never-seen when unbound.
is_missing
Return whether selection produced no usable value.
Returns: true for absent, safe-default, or not-selected states.
is_stale
Return whether selection reused or rejected stale history.
Returns: true for a reused value or a kTooStale reason.
receive
Copy the selected scalar sample and its metadata.
Repeated calls return independent copies of the same frozen selection; they do not pop a queue or advance selection state. Each success nevertheless owns an independent finite read claim until that sample and all of its copies are destroyed.
Returns: An owning sample, or the deterministic accessor error.
receive_data
Copy only the selected scalar payload.
The public semantic copy is ordinary caller-observable C++ behavior. Runtime-internal materialization failures are classified by the bound scalar operation before this copy. This payload-only accessor acquires no finite sample read claim.
Returns: Owning payload value, or the same classified error as receive.
Throws: Any exception raised by the admitted semantic copy in an exception-enabled build.
selected_sample
Borrow the frozen scalar selection without copying or acquiring a read claim.
Repeated calls expose the same sample, even when owning read claims are exhausted. The view does not extend descriptor, Tensor, or backing ownership. Submit GPU work only on Runtime-registered streams; do not retain the view or its descriptor pointers past compute.
Returns: Immutable activation-scoped view, or the same classified scalar accessor error.
selected_batch
Borrow the completed batch-shaped selection.
Returns: Immutable activation-scoped view, including a successful empty view, or a classified accessor error.
for_each_selected
Invoke a fallible callable for each selected batch sample.
The callable is bound once as an lvalue before iteration; an rvalue callable is never repeatedly forwarded or moved between selected samples.
Returns: Success after every call, or the first accessor/callable error.
Template parameters
Parameters
Callable invoked in frozen selection order.
name
Return the cold declaration name.
Returns: View valid until this port is destroyed.