Skip to main content

Sample Struct

Typed payload returned by Run::pull() and consumed by Run::push(). More...

Declaration

struct simaai::neat::Sample { ... }

Included Headers

#include <GraphOptions.h>

Public Operators Index

Sample &operator[] (std::size_t i)

Logical field access. For non-Bundle Samples only index 0 is meaningful. More...

const Sample &operator[] (std::size_t i) const

Public Member Functions Index

boolempty () const noexcept

Returns true when this Sample carries no payload. More...

std::size_tsize () const noexcept

Number of logical payloads represented by this Sample. More...

voidreserve (std::size_t n)

Reserve Bundle field storage. Turns an empty Sample into a Bundle builder. More...

voidpush_back (Sample sample)

Append a field to this Sample. Turns an empty Sample into a Bundle builder. More...

Sample &front ()

First logical payload. For non-Bundle Samples, this is the Sample itself. More...

const Sample &front () const
Sample &back ()

Last logical payload. For non-Bundle Samples, this is the Sample itself. More...

const Sample &back () const
iteratorbegin ()
iteratorend ()
const_iteratorbegin () const
const_iteratorend () const
const_iteratorcbegin () const
const_iteratorcend () const

Public Member Attributes Index

SampleKindkind = SampleKind::Unknown

Discriminator: which payload field is meaningful. More...

boolowned = ...

If false, the framework holds a borrowed reference to the underlying buffer. More...

std::optional< simaai::neat::Tensor >tensor

Set when kind == Tensor. More...

TensorListtensors

Set when kind == TensorSet. More...

std::vector< Sample >fields

Set when kind == Bundle (recursive multi-logical-output). More...

std::stringcaps_string

Caps string from the source GStreamer buffer (for media-typed payloads). More...

PayloadTypepayload_type = PayloadType::Auto

Public semantic payload family. More...

std::stringmedia_type

MIME-style media type (e.g., "video/x-raw", "application/vnd.simaai.tensor"). More...

std::stringpayload_tag

Subformat tag (e.g., "NV12", "FP32", "INT8"). More...

std::stringformat

Subformat tag for the payload. More...

int64_tframe_id = -1

Source-assigned frame ID, when carried. More...

std::stringstream_id

Stream identifier (multi-stream pipelines). More...

std::stringstream_label

Human-readable stream label. More...

std::stringport_name

Ingress port name (multi-input models). More...

intoutput_index = -1

Logical output index this sample corresponds to. More...

intlogical_output_index = -1

Logical output index this sample corresponds to. More...

intmemory_index = -1

Underlying memory segment index (advanced; for zero-copy routing). More...

introute_slot = -1

Route-graph slot identifier (advanced). More...

std::stringsegment_name

Memory segment name (advanced). More...

int64_tinput_seq = -1

Input sequence number assigned at push time (lets pull match push). More...

int64_torig_input_seq = ...

Original input sequence (when re-numbered through a sub-pipeline). More...

int64_tpts_ns = -1

Presentation timestamp in nanoseconds (-1 if absent). More...

int64_tdts_ns = -1

Decoding timestamp in nanoseconds (-1 if absent). More...

int64_tduration_ns = -1

Sample duration in nanoseconds (-1 if absent). More...

Description

Typed payload returned by Run::pull() and consumed by Run::push().

A Sample is a tagged union: depending on kind, exactly one of tensor, tensors, or fields is meaningful. Includes per-buffer metadata: stream/port labels, timestamps, frame IDs, and routing slot information. Use make_tensor_sample(), make_image_sample(), or make_bundle_sample() to construct typed Samples ergonomically.

Definition at line 462 of file GraphOptions.h.

Public Operators

operator[]()

Sample & simaai::neat::Sample::operator[] (std::size_t i)
inline

Logical field access. For non-Bundle Samples only index 0 is meaningful.

Definition at line 565 of file GraphOptions.h.

operator[]()

const Sample & simaai::neat::Sample::operator[] (std::size_t i)
inline

Definition at line 571 of file GraphOptions.h.

Public Member Functions

back()

Sample & simaai::neat::Sample::back ()
inline

Last logical payload. For non-Bundle Samples, this is the Sample itself.

Definition at line 551 of file GraphOptions.h.

back()

const Sample & simaai::neat::Sample::back ()
inline

Definition at line 557 of file GraphOptions.h.

begin()

iterator simaai::neat::Sample::begin ()
inline

Definition at line 640 of file GraphOptions.h.

begin()

const_iterator simaai::neat::Sample::begin ()
inline

Definition at line 646 of file GraphOptions.h.

cbegin()

const_iterator simaai::neat::Sample::cbegin ()
inline

Definition at line 652 of file GraphOptions.h.

cend()

const_iterator simaai::neat::Sample::cend ()
inline

Definition at line 655 of file GraphOptions.h.

empty()

bool simaai::neat::Sample::empty ()
inline noexcept

Returns true when this Sample carries no payload.

Definition at line 501 of file GraphOptions.h.

end()

iterator simaai::neat::Sample::end ()
inline

Definition at line 643 of file GraphOptions.h.

end()

const_iterator simaai::neat::Sample::end ()
inline

Definition at line 649 of file GraphOptions.h.

front()

Sample & simaai::neat::Sample::front ()
inline

First logical payload. For non-Bundle Samples, this is the Sample itself.

Definition at line 537 of file GraphOptions.h.

front()

const Sample & simaai::neat::Sample::front ()
inline

Definition at line 543 of file GraphOptions.h.

push_back()

void simaai::neat::Sample::push_back (Sample sample)
inline

Append a field to this Sample. Turns an empty Sample into a Bundle builder.

Definition at line 526 of file GraphOptions.h.

reserve()

void simaai::neat::Sample::reserve (std::size_t n)
inline

Reserve Bundle field storage. Turns an empty Sample into a Bundle builder.

Definition at line 518 of file GraphOptions.h.

size()

std::size_t simaai::neat::Sample::size ()
inline noexcept

Number of logical payloads represented by this Sample.

A Bundle reports its number of fields. Any non-empty non-Bundle Sample reports 1. This intentionally lets Sample replace the former "list of Samples" surface while keeping a single recursive public payload type.

Definition at line 510 of file GraphOptions.h.

Public Member Attributes

caps_string

std::string simaai::neat::Sample::caps_string

Caps string from the source GStreamer buffer (for media-typed payloads).

Definition at line 472 of file GraphOptions.h.

dts_ns

int64_t simaai::neat::Sample::dts_ns = -1

Decoding timestamp in nanoseconds (-1 if absent).

Definition at line 497 of file GraphOptions.h.

duration_ns

int64_t simaai::neat::Sample::duration_ns = -1

Sample duration in nanoseconds (-1 if absent).

Definition at line 498 of file GraphOptions.h.

fields

std::vector<Sample> simaai::neat::Sample::fields

Set when kind == Bundle (recursive multi-logical-output).

Definition at line 469 of file GraphOptions.h.

format

std::string simaai::neat::Sample::format

Subformat tag for the payload.

Deprecated

Use payload_tag. Kept for transition.

Definition at line 480 of file GraphOptions.h.

frame_id

int64_t simaai::neat::Sample::frame_id = -1

Source-assigned frame ID, when carried.

Definition at line 482 of file GraphOptions.h.

input_seq

int64_t simaai::neat::Sample::input_seq = -1

Input sequence number assigned at push time (lets pull match push).

Definition at line 493 of file GraphOptions.h.

kind

SampleKind simaai::neat::Sample::kind = SampleKind::Unknown

Discriminator: which payload field is meaningful.

Definition at line 463 of file GraphOptions.h.

logical_output_index

int simaai::neat::Sample::logical_output_index = -1

Logical output index this sample corresponds to.

Definition at line 489 of file GraphOptions.h.

media_type

std::string simaai::neat::Sample::media_type

MIME-style media type (e.g., "video/x-raw", "application/vnd.simaai.tensor").

Definition at line 474 of file GraphOptions.h.

memory_index

int simaai::neat::Sample::memory_index = -1

Underlying memory segment index (advanced; for zero-copy routing).

Definition at line 490 of file GraphOptions.h.

orig_input_seq

int64_t simaai::neat::Sample::orig_input_seq

Original input sequence (when re-numbered through a sub-pipeline).

Initialiser
= -1

Definition at line 494 of file GraphOptions.h.

output_index

int simaai::neat::Sample::output_index = -1

Logical output index this sample corresponds to.

Deprecated

Legacy alias for logical_output_index.

Definition at line 488 of file GraphOptions.h.

owned

bool simaai::neat::Sample::owned

If false, the framework holds a borrowed reference to the underlying buffer.

Initialiser
= true

Definition at line 464 of file GraphOptions.h.

payload_tag

std::string simaai::neat::Sample::payload_tag

Subformat tag (e.g., "NV12", "FP32", "INT8").

Replaces deprecated format.

Definition at line 476 of file GraphOptions.h.

payload_type

PayloadType simaai::neat::Sample::payload_type = PayloadType::Auto

Public semantic payload family.

Definition at line 473 of file GraphOptions.h.

port_name

std::string simaai::neat::Sample::port_name

Ingress port name (multi-input models).

Definition at line 485 of file GraphOptions.h.

pts_ns

int64_t simaai::neat::Sample::pts_ns = -1

Presentation timestamp in nanoseconds (-1 if absent).

Definition at line 496 of file GraphOptions.h.

route_slot

int simaai::neat::Sample::route_slot = -1

Route-graph slot identifier (advanced).

Definition at line 491 of file GraphOptions.h.

segment_name

std::string simaai::neat::Sample::segment_name

Memory segment name (advanced).

Definition at line 492 of file GraphOptions.h.

stream_id

std::string simaai::neat::Sample::stream_id

Stream identifier (multi-stream pipelines).

Definition at line 483 of file GraphOptions.h.

stream_label

std::string simaai::neat::Sample::stream_label

Human-readable stream label.

Definition at line 484 of file GraphOptions.h.

tensor

std::optional<simaai::neat::Tensor> simaai::neat::Sample::tensor

Set when kind == Tensor.

Definition at line 467 of file GraphOptions.h.

tensors

TensorList simaai::neat::Sample::tensors

Set when kind == TensorSet.

Definition at line 468 of file GraphOptions.h.


The documentation for this struct was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.