Run Class
Live pipeline handle: push inputs in, pull outputs out. More...
Declaration
Included Headers
Friends Index
| class | MeasureScope |
| class | Graph |
Public Constructors Index
| Run ()=default | |
|
Construct an empty Run; assign from Graph::build() before use. More... | |
| Run (const Run &)=delete | |
|
Non-copyable. More... | |
| Run (Run &&) noexcept | |
|
Move-constructible. More... | |
Private Constructors Index
| Run (std::shared_ptr< runtime::RunCore > core) | |
Public Destructor Index
| ~Run () | |
|
Cleanly tears down the pipeline. More... | |
Public Operators Index
| Run & | operator= (const Run &)=delete |
|
Non-copyable. More... | |
| Run & | operator= (Run &&) noexcept |
|
Move-assignable. More... | |
| operator bool () const noexcept | |
|
Returns true if the Run is alive (constructed by Graph::build, not yet stopped). More... | |
Public Member Functions Index
| bool | can_push () const |
|
Returns true if the input side accepts pushes (not closed). More... | |
| bool | can_pull () const |
|
Returns true if the output side may produce more samples (pipeline not at EOS). More... | |
| bool | running () const |
|
Returns true if the pipeline is in PLAYING state. More... | |
| std::vector< std::string > | input_names () const |
|
Names accepted by push(name, ...) for graph-backed Runs. Empty for unnamed/linear Runs. More... | |
| std::vector< std::string > | output_names () const |
|
Names accepted by pull(name, ...) for graph-backed Runs. Empty for unnamed/linear Runs. More... | |
| bool | push (const std::vector< cv::Mat > &inputs) |
|
Push cv::Mat inputs into the pipeline. More... | |
| bool | push (std::string_view input_name, const std::vector< cv::Mat > &inputs) |
|
Push cv::Mat inputs into a named graph ingress. Use for multi-input graphs. More... | |
| bool | try_push (const std::vector< cv::Mat > &inputs) |
|
Non-blocking variant of push; returns false immediately if the queue is full. More... | |
| bool | try_push (std::string_view input_name, const std::vector< cv::Mat > &inputs) |
|
Non-blocking named-ingress variant. More... | |
| bool | push (const TensorList &inputs) |
| bool | push (std::string_view input_name, const TensorList &inputs) |
|
Push Tensor inputs into a named graph ingress. Use for multi-input graphs. More... | |
| bool | try_push (const TensorList &inputs) |
|
Non-blocking variant. More... | |
| bool | try_push (std::string_view input_name, const TensorList &inputs) |
|
Non-blocking named-ingress variant. More... | |
| bool | push (const Sample &msgs) |
|
Push full Sample inputs (carrying per-buffer metadata). More... | |
| bool | push (std::string_view input_name, const Sample &msgs) |
|
Push full Sample inputs into a named graph ingress. Use for multi-input graphs. More... | |
| bool | try_push (const Sample &msgs) |
|
Non-blocking variant. More... | |
| bool | try_push (std::string_view input_name, const Sample &msgs) |
|
Non-blocking named-ingress variant. More... | |
| bool | push_holder (const std::shared_ptr< void > &holder) |
|
Internal: pushes a GstBuffer held by a tensor ref to preserve plugin metadata. More... | |
| bool | try_push_holder (const std::shared_ptr< void > &holder) |
|
Non-blocking variant of push_holder. More... | |
| void | close_input () |
|
Send EOS into the pipeline. More... | |
| PullStatus | pull (int timeout_ms, Sample &out, PullError *err=nullptr) |
|
Pull the next output sample with a structured status return. More... | |
| PullStatus | pull (std::string_view output_name, int timeout_ms, Sample &out, PullError *err=nullptr) |
|
Pull from a named graph output with structured status. More... | |
| std::optional< Sample > | pull (int timeout_ms=-1) |
|
Convenience pull returning an optional Sample (empty on timeout/closed; throws on error). More... | |
| std::optional< Sample > | pull (std::string_view output_name, int timeout_ms=-1) |
|
Convenience named-output pull (empty on timeout/closed; throws on error). More... | |
| TensorList | pull_tensors (int timeout_ms=-1) |
|
Pull and unpack the next sample as a TensorList. More... | |
| TensorList | pull_tensors (std::string_view output_name, int timeout_ms=-1) |
|
Pull and unpack from a named graph output as a TensorList. More... | |
| Sample | pull_samples (int timeout_ms=-1) |
|
Pull the next sample as a Sample (preserves per-sample metadata). More... | |
| Sample | pull_samples (std::string_view output_name, int timeout_ms=-1) |
|
Pull samples from a named graph output (preserves per-sample metadata). More... | |
| TensorList | run (const std::vector< cv::Mat > &inputs, int timeout_ms=-1) |
|
One-shot synchronous push+pull from cv::Mat inputs. More... | |
| TensorList | run (const TensorList &inputs, int timeout_ms=-1) |
| Sample | run (const Sample &inputs, int timeout_ms=-1) |
| MeasureScope | start_measurement (const MeasureOptions &opt={}) |
|
Start observing a caller-owned push/pull interval without consuming outputs. More... | |
| std::string | last_error () const |
|
Returns the most recent runtime error string (empty if no error occurred). More... | |
| void | stop () |
|
Stop the pipeline immediately (transitions to NULL). After stop, the Run is no longer running. More... | |
| void | close () |
Private Member Functions Index
| void | require_async_mode (const char *where) const |
| void | require_async_pull_mode (const char *where) const |
| void | enqueue_run_images (const std::vector< cv::Mat > &inputs) |
| void | enqueue_run_tensors (const TensorList &inputs) |
| void | enqueue_run_samples (const Sample &inputs) |
| TensorList | pull_tensors_strict (int timeout_ms) |
| Sample | pull_samples_strict (int timeout_ms) |
| bool | push_impl (const cv::Mat &input, bool block) |
| bool | push_impl (const simaai::neat::Tensor &input, bool block) |
| bool | push_holder_impl (const std::shared_ptr< void > &holder, bool block) |
| bool | push_message_impl (const Sample &msg, bool block) |
| bool | push_sample_impl (const Sample &msg, bool block) |
Private Member Attributes Index
| std::shared_ptr< runtime::RunCore > | core_ |
Private Static Functions Index
| static Run | create (InputStream stream, const RunOptions &opt, const struct InputStreamOptions &stream_opt, RunMode mode=RunMode::Async, const std::optional< InputOptions > &tensor_input_opt_for_cv=std::nullopt, pipeline_internal::InputRouteProcessorPtr input_route_processor=nullptr) |
Description
Live pipeline handle: push inputs in, pull outputs out.
A Run is what Graph::build() returns. It owns the live GStreamer pipeline plus its internal worker threads (typically 5–15 per Run, including streaming threads, dispatcher pool threads, and a bus watcher). Application code drives the Run by push()-ing inputs and pull()-ing outputs (or run() for one-shot synchronous use).
Thread safety: push() from one thread and pull() from another is safe. Multiple threads push-ing the same Run concurrently is NOT safe — serialize push from one thread or use external synchronization.
Runs are non-copyable but movable. Destroying a Run shuts down its pipeline cleanly (sends EOS, drains, transitions to NULL).
- See Also
Graph::build for how a Run is constructed
- See Also
RunOptions for runtime configuration
- See Also
"Runs and the parallelism story" (§0.13 of the design deep dive)
Definition at line 594 of file Run.h.
Public Constructors
Run()
| default |
Construct an empty Run; assign from Graph::build() before use.
Definition at line 597 of file Run.h.
Run()
Run()
Private Constructors
Run()
| explicit |
Definition at line 705 of file Run.h.
Public Destructor
~Run()
|
Cleanly tears down the pipeline.
Definition at line 603 of file Run.h.
Public Operators
operator bool()
| explicit noexcept |
Returns true if the Run is alive (constructed by Graph::build, not yet stopped).
Definition at line 606 of file Run.h.
operator=()
| delete |
Non-copyable.
Definition at line 599 of file Run.h.
operator=()
Public Member Functions
can_pull()
|
Returns true if the output side may produce more samples (pipeline not at EOS).
Definition at line 610 of file Run.h.
can_push()
|
Returns true if the input side accepts pushes (not closed).
Definition at line 608 of file Run.h.
close()
|
close_input()
|
Send EOS into the pipeline.
Drain remaining outputs by continuing to pull until PullStatus::Closed.
Definition at line 651 of file Run.h.
input_names()
|
Names accepted by push(name, ...) for graph-backed Runs. Empty for unnamed/linear Runs.
Definition at line 614 of file Run.h.
last_error()
|
Returns the most recent runtime error string (empty if no error occurred).
Definition at line 690 of file Run.h.
output_names()
|
Names accepted by pull(name, ...) for graph-backed Runs. Empty for unnamed/linear Runs.
Definition at line 616 of file Run.h.
pull()
Pull the next output sample with a structured status return.
- Parameters
-
timeout_ms Wait up to this many ms; -1 waits forever; 0 is non-blocking.
out Filled with the next sample on Ok.
err Optional out-parameter populated on Error with a structured PullError.
- Returns
Ok, Timeout, Closed, or Error.
Definition at line 659 of file Run.h.
pull()
pull()
|
pull()
|
Convenience named-output pull (empty on timeout/closed; throws on error).
Definition at line 671 of file Run.h.
pull_samples()
|
pull_samples()
|
Pull samples from a named graph output (preserves per-sample metadata).
Definition at line 679 of file Run.h.
pull_tensors()
|
Pull and unpack the next sample as a TensorList.
Definition at line 673 of file Run.h.
pull_tensors()
|
Pull and unpack from a named graph output as a TensorList.
Definition at line 675 of file Run.h.
push()
|
Push cv::Mat inputs into the pipeline.
Multi-input models accept one Mat per ingress.
- Returns
true on success; behavior on full queue is governed by RunOptions::overflow_policy.
Definition at line 622 of file Run.h.
push()
|
Push cv::Mat inputs into a named graph ingress. Use for multi-input graphs.
Definition at line 624 of file Run.h.
push()
|
push()
|
push()
|
push()
|
push_holder()
|
Internal: pushes a GstBuffer held by a tensor ref to preserve plugin metadata.
Definition at line 646 of file Run.h.
run()
|
One-shot synchronous push+pull from cv::Mat inputs.
Definition at line 681 of file Run.h.
run()
|
run()
|
running()
|
Returns true if the pipeline is in PLAYING state.
Definition at line 612 of file Run.h.
start_measurement()
|
Start observing a caller-owned push/pull interval without consuming outputs.
Definition at line 688 of file Run.h.
stop()
|
try_push()
|
Non-blocking variant of push; returns false immediately if the queue is full.
Definition at line 626 of file Run.h.
try_push()
|
Non-blocking named-ingress variant.
Definition at line 628 of file Run.h.
try_push()
|
Non-blocking variant.
Definition at line 634 of file Run.h.
try_push()
|
Non-blocking named-ingress variant.
Definition at line 636 of file Run.h.
try_push()
|
Non-blocking variant.
Definition at line 642 of file Run.h.
try_push()
|
Non-blocking named-ingress variant.
Definition at line 644 of file Run.h.
try_push_holder()
|
Non-blocking variant of push_holder.
Definition at line 648 of file Run.h.
Private Member Functions
enqueue_run_images()
|
Definition at line 708 of file Run.h.
enqueue_run_samples()
|
Definition at line 710 of file Run.h.
enqueue_run_tensors()
|
Definition at line 709 of file Run.h.
pull_samples_strict()
|
Definition at line 712 of file Run.h.
pull_tensors_strict()
|
Definition at line 711 of file Run.h.
push_holder_impl()
|
Definition at line 715 of file Run.h.
push_impl()
|
Definition at line 713 of file Run.h.
push_impl()
|
Definition at line 714 of file Run.h.
push_message_impl()
|
Definition at line 716 of file Run.h.
push_sample_impl()
|
Definition at line 717 of file Run.h.
require_async_mode()
|
Definition at line 706 of file Run.h.
require_async_pull_mode()
|
Definition at line 707 of file Run.h.
Private Member Attributes
core_
|
Definition at line 703 of file Run.h.
Private Static Functions
create()
| static |
Definition at line 718 of file Run.h.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.