Skip to navigation

holoscan::channel_internal::TensorSchemaPayloadPublisher

Beta
View as Markdown

Transport interface for schema payloads and Tensor ownership.

#include <holoscan/channel_internal/endpoint_interfaces.hpp>

Constructors

TensorSchemaPayloadPublisher

holoscan::channel_internal::TensorSchemaPayloadPublisher::TensorSchemaPayloadPublisher() = default

Destructor

~TensorSchemaPayloadPublisher

virtual HOLOSCAN_CORE_EXPORT holoscan::channel_internal::TensorSchemaPayloadPublisher::~TensorSchemaPayloadPublisher()

Assignment operators

operator=

The following overloads are deleted to prevent misuse:

TensorSchemaPayloadPublisher & holoscan::channel_internal::TensorSchemaPayloadPublisher::operator=(const TensorSchemaPayloadPublisher &) = delete;
TensorSchemaPayloadPublisher & holoscan::channel_internal::TensorSchemaPayloadPublisher::operator=(TensorSchemaPayloadPublisher &&) = delete;

Methods

reserve_tensors

inline
expected<TensorSchemaPayloadReservation, Error> holoscan::channel_internal::TensorSchemaPayloadPublisher::reserve_tensors(
std::span<const Tensor> tensors
)

Reserve transport state and ownership for canonically indexed Tensor fields.

Returns: Aggregate reservation on success, or Error after rolling back every partial claim.

Parameters

tensors
std::span<const Tensor>

Tensors retained through the configured local or interprocess transport path.

publish_payload

virtual expected<std::uint32_t, Error> holoscan::channel_internal::TensorSchemaPayloadPublisher::publish_payload(
std::span<const std::byte> payload,
SampleMetadata transport_metadata = {}
)

Publish schema bytes with their reserved Tensor payload reference.

Returns: Recipient count on success, or Error for invalid size, loan, or send failure.

Parameters

payload
std::span<const std::byte>

Serialized schema payload bytes.

reservation
TensorSchemaPayloadReservation

Descriptor and optional Tensor ownership consumed by the publication.

transport_metadata
SampleMetadataDefaults to {}

Catalog operation metadata, or an empty record for a manual channel.

publish_encoded_payload

virtual expected<std::uint32_t, Error> holoscan::channel_internal::TensorSchemaPayloadPublisher::publish_encoded_payload(
SampleMetadata transport_metadata = {}
)

Encode directly into an outbound transport loan and publish its used prefix.

Returns: Recipient count on success, or a checked pre-submit or publication error.

Parameters

encoder
const TensorSchemaPayloadEncoder &

Allocation-free encoder callback and bounded codec capacity.

reservation
TensorSchemaPayloadReservation

Descriptor and Tensor ownership consumed by the publication.

transport_metadata
SampleMetadataDefaults to {}

Catalog operation metadata, or an empty record for a manual channel.

validate_sample_metadata

virtual expected<void, Error> holoscan::channel_internal::TensorSchemaPayloadPublisher::validate_sample_metadata(
const SampleMetadata &metadata
) const noexcept

Validate caller-authored semantic metadata for this endpoint.

Returns: Success when the metadata belongs to this endpoint’s capture-clock contract.

Parameters

metadata
const SampleMetadata &

Metadata before sequence, byte size, and payload kind normalization.

validate_field_descriptor

virtual expected<void, Error> holoscan::channel_internal::TensorSchemaPayloadPublisher::validate_field_descriptor(
std::uint32_t field_index,
const TensorViewMetadata &metadata,
const PayloadDescriptor &descriptor
) const noexcept

Validate one decoded descriptor field against this endpoint’s immutable contract.

The default implementation accepts every field. Third-party catalog transports must override this function to enforce immutable descriptor-field contracts.

Returns: Success for an admitted field, or a checked pre-submit contract error.

Parameters

field_index
std::uint32_t

Canonical Tensor-field index.

metadata
const TensorViewMetadata &

Schema-derived Tensor view metadata.

descriptor
const PayloadDescriptor &

Transport descriptor paired with the schema field.

make_capture_time

virtual expected<TimePoint, Error> holoscan::channel_internal::TensorSchemaPayloadPublisher::make_capture_time(
std::int64_t timestamp_ns
) const noexcept

Label one capture coordinate with this endpoint’s catalog clock.

Returns: Bound time point, or ErrorCode::kInvalidArgument when unavailable.

Parameters

timestamp_ns
std::int64_t

Exact caller-supplied nanosecond coordinate.

report_clock_health

virtual expected<void, Error> holoscan::channel_internal::TensorSchemaPayloadPublisher::report_clock_health(
)

Publish one ordered catalog clock-health operation.

Returns: Success after bounded acceptance, or a checked unsupported/publication error.

Parameters

report
ClockHealthReport

Valid payload-independent health assessment.

close_stream

virtual InlinePublicationResult holoscan::channel_internal::TensorSchemaPayloadPublisher::close_stream(
SampleMetadata metadata
)

Publish an ordered end-of-stream operation for this catalog generation.

Returns: Submit phase, recipient count, and checked error evidence for authority accounting.

Parameters

metadata
SampleMetadata

Sequence and semantic payload identity for the terminal operation.

producer_generation

virtual std::uint64_t holoscan::channel_internal::TensorSchemaPayloadPublisher::producer_generation() const noexcept

Return this catalog publisher’s producer-incarnation identity.

Returns: Nonzero identity for catalog publishers; zero for manual compatibility publishers.

next_operation_sequence

virtual expected<std::uint64_t, Error> holoscan::channel_internal::TensorSchemaPayloadPublisher::next_operation_sequence() const noexcept

Return the next ordered catalog operation sequence without consuming it.

Returns: Next nonzero sequence, or a checked unsupported/closed/exhaustion error.

release_tensor

virtual void holoscan::channel_internal::TensorSchemaPayloadPublisher::release_tensor(
) noexcept

Release an unpublished Tensor reservation.

This function does not throw.

Parameters

reservation
TensorSchemaPayloadReservation

Reservation whose local sidecar claim or retained owner is released.

update_connections

virtual expected<void, Error> holoscan::channel_internal::TensorSchemaPayloadPublisher::update_connections() noexcept

Refresh backend connection state.

Returns: Empty success or Error when the backend refresh fails.

has_subscribers

virtual bool holoscan::channel_internal::TensorSchemaPayloadPublisher::has_subscribers() const noexcept

Return whether at least one subscriber is connected.

Returns: True when a subscriber is connected; false otherwise.

tensor_memory_options

virtual expected<MemoryBuffer::Options, Error> holoscan::channel_internal::TensorSchemaPayloadPublisher::tensor_memory_options() const

Return graph-derived Tensor allocation options.

Returns: MemoryBuffer options on success, or Error when unavailable.