Sample Struct
Typed payload returned by Run::pull() and consumed by Run::push(). More...
Declaration
Included Headers
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
| bool | empty () const noexcept |
| std::size_t | size () const noexcept |
|
Number of logical payloads represented by this Sample. More... | |
| void | reserve (std::size_t n) |
|
Reserve Bundle field storage. Turns an empty Sample into a Bundle builder. More... | |
| void | push_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 |
| iterator | begin () |
| iterator | end () |
| const_iterator | begin () const |
| const_iterator | end () const |
| const_iterator | cbegin () const |
| const_iterator | cend () const |
Public Member Attributes Index
| SampleKind | kind = SampleKind::Unknown |
|
Discriminator: which payload field is meaningful. More... | |
| bool | owned = ... |
|
If false, the framework holds a borrowed reference to the underlying buffer. More... | |
| std::optional< simaai::neat::Tensor > | tensor |
| TensorList | tensors |
|
Set when kind == TensorSet. More... | |
| std::vector< Sample > | fields |
|
Set when kind == Bundle (recursive multi-logical-output). More... | |
| std::string | caps_string |
|
Caps string from the source GStreamer buffer (for media-typed payloads). More... | |
| PayloadType | payload_type = PayloadType::Auto |
|
Public semantic payload family. More... | |
| std::string | media_type |
|
MIME-style media type (e.g., "video/x-raw", "application/vnd.simaai.tensor"). More... | |
| std::string | payload_tag |
|
Subformat tag (e.g., "NV12", "FP32", "INT8"). More... | |
| std::string | format |
|
Subformat tag for the payload. More... | |
| int64_t | frame_id = -1 |
|
Source-assigned frame ID, when carried. More... | |
| std::string | stream_id |
|
Stream identifier (multi-stream pipelines). More... | |
| std::string | stream_label |
|
Human-readable stream label. More... | |
| std::string | port_name |
|
Ingress port name (multi-input models). More... | |
| int | output_index = -1 |
|
Logical output index this sample corresponds to. More... | |
| int | logical_output_index = -1 |
|
Logical output index this sample corresponds to. More... | |
| int | memory_index = -1 |
|
Underlying memory segment index (advanced; for zero-copy routing). More... | |
| int | route_slot = -1 |
|
Route-graph slot identifier (advanced). More... | |
| std::string | segment_name |
|
Memory segment name (advanced). More... | |
| int64_t | input_seq = -1 |
|
Input sequence number assigned at push time (lets pull match push). More... | |
| int64_t | orig_input_seq = ... |
|
Original input sequence (when re-numbered through a sub-pipeline). More... | |
| int64_t | pts_ns = -1 |
|
Presentation timestamp in nanoseconds (-1 if absent). More... | |
| int64_t | dts_ns = -1 |
|
Decoding timestamp in nanoseconds (-1 if absent). More... | |
| int64_t | duration_ns = -1 |
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 504 of file GraphOptions.h.
Public Operators
operator[]()
| inline |
Logical field access. For non-Bundle Samples only index 0 is meaningful.
Definition at line 607 of file GraphOptions.h.
operator[]()
| inline |
Definition at line 613 of file GraphOptions.h.
Public Member Functions
back()
| inline |
Last logical payload. For non-Bundle Samples, this is the Sample itself.
Definition at line 593 of file GraphOptions.h.
back()
| inline |
Definition at line 599 of file GraphOptions.h.
begin()
| inline |
Definition at line 682 of file GraphOptions.h.
begin()
| inline |
Definition at line 688 of file GraphOptions.h.
cbegin()
| inline |
Definition at line 694 of file GraphOptions.h.
cend()
| inline |
Definition at line 697 of file GraphOptions.h.
empty()
| inline noexcept |
Returns true when this Sample carries no payload.
Definition at line 543 of file GraphOptions.h.
end()
| inline |
Definition at line 685 of file GraphOptions.h.
end()
| inline |
Definition at line 691 of file GraphOptions.h.
front()
| inline |
First logical payload. For non-Bundle Samples, this is the Sample itself.
Definition at line 579 of file GraphOptions.h.