Skip to navigation

holoscan::schema::make_standard_descriptor_tensor_port_type_ops

Beta
View as Markdown
template <typename Native,
typename Root,
std::size_t MetadataCapacity,
auto... TensorMembers,
typename Codec>
holoscan::detail::RuntimePortTypeOps holoscan::schema::make_standard_descriptor_tensor_port_type_ops(
Codec codec
) noexcept

Build descriptor-backed Runtime operations with SDK-owned standard defaults.

The adapter cold-constructs persistent sample storage, retains one Tensor holder per named native member, builds metadata-only Tensor tables in bounded storage, validates received Tensor metadata against authoritative handles, and commits Tensor handles plus SampleMetadata. The stateless codec supplies only schema-specific ordinary-field work:

  • optional prepare(Native&) -> expected<void, Error>;
  • optional reset(Native&) -> void noexcept;
  • encode_root(FlatBufferBuilder&, const Native&, span<const Offset<schema::Tensor>>) -> expected<Offset<Root>, Error>; and
  • assign_root(Native&, const Root&) -> expected<void, Error>.

prepare and reset may initialize or clear ordinary fields but must not replace the named Tensor holders. assign_root must validate before mutation, assign every ordinary field including absent optionals, and leave the Tensor members untouched; after it succeeds, the adapter commits all authoritative Tensor handles and sample metadata.

TensorMembers are ordered in canonical FlatBuffers field-id order and must exactly match the trait-declared static Tensor count. Generated native-bounds storage is selected only for the exact generated default codec. A separately supplied codec retains its own prepare, reset, and assignment hooks through the standard sample-storage path, even when the native type also has prepared traits.

Returns: Complete process-local descriptor-backed Runtime operations table.

Template parameters

Native
typename

Owning generated object-API type exposed on ports.

Root
typename

Generated FlatBuffers metadata root.

MetadataCapacity
std::size_t

Exact positive bounded metadata capacity.

TensorMembers
auto...

Ordered std::shared_ptr<Tensor> members of Native.

Codec
typename

Deduced empty/default-constructible schema-specific codec.

Parameters

codec
Codec

Stateless codec value used only to deduce Codec.