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 382 of file GraphOptions.h.
Public Operators
operator[]()
| inline |
Logical field access. For non-Bundle Samples only index 0 is meaningful.
Definition at line 485 of file GraphOptions.h.
operator[]()
| inline |
Definition at line 491 of file GraphOptions.h.
Public Member Functions
back()
| inline |
Last logical payload. For non-Bundle Samples, this is the Sample itself.
Definition at line 471 of file GraphOptions.h.
back()
| inline |
Definition at line 477 of file GraphOptions.h.
begin()
| inline |
begin()
| inline |
Definition at line 566 of file GraphOptions.h.
cbegin()
| inline |
Definition at line 572 of file GraphOptions.h.
cend()
| inline |
Definition at line 575 of file GraphOptions.h.
empty()
| inline noexcept |
Returns true when this Sample carries no payload.
Definition at line 421 of file GraphOptions.h.
end()
| inline |
end()
| inline |
Definition at line 569 of file GraphOptions.h.
front()
| inline |
First logical payload. For non-Bundle Samples, this is the Sample itself.
Definition at line 457 of file GraphOptions.h.
front()
| inline |
Definition at line 463 of file GraphOptions.h.
push_back()
| inline |
Append a field to this Sample. Turns an empty Sample into a Bundle builder.
Definition at line 446 of file GraphOptions.h.
reserve()
| inline |
Reserve Bundle field storage. Turns an empty Sample into a Bundle builder.
Definition at line 438 of file GraphOptions.h.
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 430 of file GraphOptions.h.
Public Member Attributes
caps_string
|
Caps string from the source GStreamer buffer (for media-typed payloads).
Definition at line 392 of file GraphOptions.h.
dts_ns
|
Decoding timestamp in nanoseconds (-1 if absent).
Definition at line 417 of file GraphOptions.h.
duration_ns
|
Sample duration in nanoseconds (-1 if absent).
Definition at line 418 of file GraphOptions.h.
fields
|
Set when kind == Bundle (recursive multi-logical-output).
Definition at line 389 of file GraphOptions.h.
format
|
Subformat tag for the payload.
- Deprecated
-
Use payload_tag. Kept for transition.
Definition at line 400 of file GraphOptions.h.
frame_id
|
Source-assigned frame ID, when carried.
Definition at line 402 of file GraphOptions.h.
input_seq
|
Input sequence number assigned at push time (lets pull match push).
Definition at line 413 of file GraphOptions.h.
kind
|
Discriminator: which payload field is meaningful.
Definition at line 383 of file GraphOptions.h.
logical_output_index
|
Logical output index this sample corresponds to.
Definition at line 409 of file GraphOptions.h.
media_type
|
MIME-style media type (e.g., "video/x-raw", "application/vnd.simaai.tensor").
Definition at line 394 of file GraphOptions.h.
memory_index
|
Underlying memory segment index (advanced; for zero-copy routing).
Definition at line 410 of file GraphOptions.h.
orig_input_seq
|
Original input sequence (when re-numbered through a sub-pipeline).
- Initialiser
-
= -1
Definition at line 414 of file GraphOptions.h.
output_index
|
Logical output index this sample corresponds to.
- Deprecated
-
Legacy alias for logical_output_index.
Definition at line 408 of file GraphOptions.h.
owned
|
If false, the framework holds a borrowed reference to the underlying buffer.
- Initialiser
-
= true
Definition at line 384 of file GraphOptions.h.
payload_tag
|
Subformat tag (e.g., "NV12", "FP32", "INT8").
Replaces deprecated format.
Definition at line 396 of file GraphOptions.h.
payload_type
|
Public semantic payload family.
Definition at line 393 of file GraphOptions.h.
port_name
|
Ingress port name (multi-input models).
Definition at line 405 of file GraphOptions.h.
pts_ns
|
Presentation timestamp in nanoseconds (-1 if absent).
Definition at line 416 of file GraphOptions.h.
route_slot
|
Route-graph slot identifier (advanced).
Definition at line 411 of file GraphOptions.h.
segment_name
|
Memory segment name (advanced).
Definition at line 412 of file GraphOptions.h.
stream_id
|
Stream identifier (multi-stream pipelines).
Definition at line 403 of file GraphOptions.h.
stream_label
|
Human-readable stream label.
Definition at line 404 of file GraphOptions.h.
tensor
|
Set when kind == Tensor.
Definition at line 387 of file GraphOptions.h.
tensors
|
The documentation for this struct was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.