Skip to navigation

holoscan::SampleMetadata

Beta
View as Markdown

Carry transport-neutral identity and timing metadata for one logical sample.

The aggregate contains no backend descriptor, slot identity, lease token, payload reference, or activation Tag. Capture-time presence is independent of payload validity. The default record is valid and has canonical absent capture and publish times because both clock identities are zero.

The compact clock identifiers carry no originating plan, clock-catalog, or registry-generation identity. A sample inherits that scope from its validated RunSession or endpoint binding. Persistence and transport must carry the scope directly or inherit it unambiguously from an immutable validated envelope or attachment before exposing or locally rebinding these identifiers.

#include <holoscan/sample.hpp>

Methods

valid

bool holoscan::SampleMetadata::valid() const noexcept

Return whether the sample is valid for ordinary processing.

Returns: false only when the kInvalid flag is present.

degraded

bool holoscan::SampleMetadata::degraded() const noexcept

Return whether the sample carries degraded evidence.

Returns: true when the kDegraded flag is present, independent of validity.

capture_time

TimePoint holoscan::SampleMetadata::capture_time() const noexcept

Return the genuine capture time carried by this sample.

Core never substitutes activation time, current time, publication time, arrival time, or a valid zero coordinate for omitted capture time. The result remains scoped to this sample’s validated clock catalog.

Returns: Capture coordinate and source clock, or canonical TimePoint{0,ClockId{0}} when capture time was omitted.

publish_time

TimePoint holoscan::SampleMetadata::publish_time() const noexcept

Return the publication time carried by this sample.

Publication time is the coordinate at which Runtime submitted this sample for publication. Runtime reads its publish clock once per publication, immediately after it assigns sequence and before any recipient or transport accepts the sample. Every fanout copy of one publication therefore reports a single coordinate, which is what lets two recipients measure delivery latency against the same event. The coordinate precedes transport queueing, serialization, and delivery, so it does not describe when any recipient observed the sample.

In-graph publications carry the Graph default clock. An exported sample carries the same instant on the same clock, but named in the receiving endpoint catalog’s clock namespace, because that catalog numbers its clocks independently of the publishing plan. An external client resolves publish_clock_id against the clock records its catalog declares.

A sample imported into this graph across an external boundary carries no publication time. Its publication belongs to the peer that produced it, whose clock this graph cannot place.

Publication is never capture. Core does not substitute this coordinate for an omitted capture_time, and an author-supplied publication coordinate does not survive publication. The result remains scoped to this sample’s validated clock catalog.

Returns: Publication coordinate and publish clock, or canonical absent time when the publish clock identity is zero.


Member variables

NameTypeDescription
versionSampleMetadataVersionSemantic metadata record version.
sequencestd::uint64_tProducer or Runtime publication sequence; zero when unstamped.
capture_timestamp_nsstd::int64_tGenuine acquisition coordinate when its clock is valid.
source_clock_idClockIdCapture-time clock domain, or zero when capture time is absent.
publish_timestamp_nsstd::int64_tPublication coordinate when its clock is valid.
publish_clock_idClockIdPublish-time clock domain, or zero when unavailable.
trace_idstd::uint64_tTrace correlation identity, or zero when absent.
frame_idstd::uint64_tApplication frame/sample identity, or zero when absent.
byte_sizestd::uint64_tLogical payload size in bytes when known.
payload_kindPayloadKindWhole-sample semantic representation.
flagsSampleFlagsValidity and degradation flags.