holoscan::SelectedSampleView
Borrow one immutable scalar sample during its Operator activation.
Copying this view neither copies the payload nor acquires a read claim. The view and all references extracted from it expire when the callback’s selection retires. Each accessor terminates on an expired view in every build, provided the Runtime owner still exists; accessing a view after that owner’s destruction is unsupported. Extracted references cannot check expiry. Use Input::receive() when ownership must outlive the activation.
Do not modify any reachable selected state, including mutable pointees exposed by generated shared-pointer fields. Const access does not enforce deep immutability. For generated prepared schema inputs, do not retain copied nested metadata shared_ptr owners past selection retirement. Reuse of that slot fails with ErrorCode::kPreparedStorageInvalid rather than mutating aliased metadata. Temporary owners destroyed before retirement are permitted; use owning receive() when metadata must outlive the activation. Releasing an escaped alias does not automatically restart a run that has already failed.
Template parameters
Published payload type of the selected sample.
Constructors
SelectedSampleView
Methods
sample
Return the selected sample without an owning copy.
Bind with const auto&; auto sample = view.sample() makes an owning copy.
Returns: Immutable activation-scoped sample reference.
data
Return the selected payload without copying it.
Returns: Immutable activation-scoped payload reference.
metadata
Return the Core sample metadata, not payload-specific metadata.
Returns: Immutable activation-scoped metadata reference.
operator*
Dereference the selected sample.
Returns: Immutable activation-scoped sample reference.
operator->
Return pointer access to the selected sample.
Returns: Immutable activation-scoped sample pointer.