Skip to navigation

holoscan::InputSpecBuilder

Beta
View as Markdown

Configure one typed input declaration during cold Operator setup.

Builder references remain valid for the lifetime of their OperatorSpec. Configuration records metadata only; it does not allocate runtime queues or bind backend endpoints.

#include <holoscan/operator_spec.hpp>

Methods

optional

InputSpecBuilder & holoscan::InputSpecBuilder::optional() noexcept

Permit this input to be intentionally unwired.

The contract must use the single-sample Exact selector and explicit SafeDefault. Selector cardinality does not restrict the admitted payload family. Trigger-guaranteed inputs, window selectors/anchors, and predicate evaluation inputs remain required. Ordinary compute-only side inputs preserve their existing selection phases. Connected inputs retain ordinary selection. An unwired input supplies no payload or fallback value; the Operator handles kSafeDefault with reason kNotConnected.

Returns: This builder for fluent declaration; repeated calls have no further effect.

queue_depth

InputSpecBuilder & holoscan::InputSpecBuilder::queue_depth(
std::uint32_t depth
) noexcept

Set the finite input history capacity requested by this declaration.

Returns: This builder for fluent cold-path configuration.

Parameters

depth
std::uint32_t

Positive number of retained sample slots.

expected_rate

HOLOSCAN_CORE_EXPORT InputSpecBuilder & holoscan::InputSpecBuilder::expected_rate(
Rate rate
)

Declare an advisory expected nominal input rate.

Returns: This builder after retaining the normalized declaration or first error.

Parameters

rate
Rate

Exact positive rational samples per second.

diagnostic_alias

InputSpecBuilder & holoscan::InputSpecBuilder::diagnostic_alias(
std::string_view alias
)

Record an alternate diagnostic display name.

An alias does not change canonical port identity or repair a declaration-name mismatch.

Returns: This builder for fluent cold-path configuration.

Throws: std::bad_alloc if storage for the copied alias cannot be allocated.

Throws: std::length_error if alias exceeds the implementation’s maximum string size.

Parameters

alias
std::string_view

Display-only name copied into cold metadata.

expects_tensor

InputSpecBuilder & holoscan::InputSpecBuilder::expects_tensor(
const TensorInputSpec &spec
)

Record one normalized consumer Tensor spec carried by this input.

Returns: This builder for fluent cold-path configuration.

Parameters

spec
const TensorInputSpec &

Representation, finite bounds, and optional conversion requirements.

accepts_projected_tensor

InputSpecBuilder & holoscan::InputSpecBuilder::accepts_projected_tensor() noexcept

Admit a Tensor projected out of a producer’s descriptor-backed schema.

Opting in is a property of the consumer, not the producer: an edge that narrows a richer payload is only well formed when the receiving Operator has said it wants the Tensor alone. Any declared Tensor contract still applies to the projected field.

Projection supports bounded same-process fanout and inter-process schema transport. Each consumer selects its own field and retains its own sample lease. Same-process delivery shares storage; inter-process delivery requires the producer’s bounded transfer policy and may stage a copy. Projection preserves sample identity without representation conversion.

Returns: This builder for fluent cold-path configuration.

payload_options

InputSpecBuilder & holoscan::InputSpecBuilder::payload_options(
)

Record schema identity and payload options carried by this input.

Returns: This builder for fluent cold-path configuration.

Parameters

options
PayloadOptions

Complete payload options copied into this builder.

tensor_field

inlinenodiscard
template <typename SchemaT>
TensorFieldInputSpecBuilder holoscan::InputSpecBuilder::tensor_field(
TensorFieldSelector<SchemaT> selector
)

Select one Tensor member for field-scoped input declarations.

The returned non-owning builder must not outlive this parent builder.

Returns: Field-scoped builder for logical and materialization requirements.

Template parameters

SchemaT
typename

Owning generated descriptor-backed schema type.

Parameters

selector
TensorFieldSelector<SchemaT>

Generated schema-typed field token.

tensor_fields

template <typename SchemaT, std::size_t N>
InputSpecBuilder & holoscan::InputSpecBuilder::tensor_fields(
const std::array<TensorFieldSelector<SchemaT>, N> &selectors,
const TensorInputSpec &spec
)

Apply one input spec to a statically listed set of Tensor fields.

Returns: This input builder.

Throws: std::bad_alloc if field-record storage cannot be allocated.

Template parameters

SchemaT
typename

Owning generated descriptor-backed schema type.

N
std::size_t

Number of listed selectors.

Parameters

selectors
const std::array<TensorFieldSelector<SchemaT>, N> &

Generated schema-typed field tokens.

spec
const TensorInputSpec &

Shared logical and conversion requirements.


Member variables

NameTypeDescription
queue_depth_std::optional< std::uint32_t >
optional_bool
rate_detail::AuthoredPortRate
diagnostic_alias_std::string
tensor_layout_std::optional< TensorRepresentation >
memory_conversion_std::optional< MemoryConversionPolicy >
payload_options_std::optional< PayloadOptionsRecord >
tensor_contract_std::optional< TensorContractRecord >
tensor_contract_error_Error
descriptor_tensor_field_count_std::uint16_t
accepts_projected_tensor_bool
tensor_fields_std::vector< detail::AuthoredTensorFieldConfiguration >