GraphRun Class
Live runtime handle for a compiled Graph. More...
Declaration
Included Headers
Friends Index
| class | GraphSession |
Public Constructors Index
| GraphRun ()=default | |
|
Default-construct an empty (non-running) handle. Useful as a movable placeholder. More... | |
| GraphRun (const GraphRun &)=delete | |
|
Copy is disabled — GraphRun owns runtime resources and is move-only. More... | |
| GraphRun (GraphRun &&) noexcept | |
|
Move-construct, transferring ownership of the underlying runtime. More... | |
Private Constructors Index
| GraphRun (std::shared_ptr< State > state) | |
Public Destructor Index
| ~GraphRun () | |
|
Destroy the handle, stopping the runtime if still running. More... | |
Public Operators Index
| GraphRun & | operator= (const GraphRun &)=delete |
|
Copy assignment is disabled — GraphRun is move-only. More... | |
| GraphRun & | operator= (GraphRun &&) noexcept |
|
Move-assign, transferring ownership of the underlying runtime. More... | |
| operator bool () const noexcept | |
|
True iff this handle owns a live runtime. More... | |
Public Member Functions Index
| bool | running () const |
|
True iff the underlying graph is currently running. More... | |
| bool | push (NodeId node_id, const Sample &sample) |
|
Push a sample to a node's default input port. Returns false on backpressure timeout. More... | |
| bool | push (NodeId node_id, PortId port, const Sample &sample) |
|
Push a sample to a specific named port on a node. More... | |
| std::optional< Sample > | pull (NodeId node_id, int timeout_ms=-1) |
|
Pull from a node's output. timeout_ms < 0 blocks; returns nullopt on timeout. More... | |
| Input | input (NodeId node_id) |
|
Get an Input push handle bound to a node's default input port. More... | |
| Input | input (NodeId node_id, PortId port) |
|
Get an Input push handle bound to a specific named port on a node. More... | |
| Output | output (NodeId node_id) |
| GraphRunStats & | enable_stats () |
|
Lazily allocate and return a stats collector tied to this run. More... | |
| const GraphRunStats * | stats () const |
|
Read the stats collector, if enable_stats() was called; else nullptr. More... | |
| PullSession | collect (const std::vector< Output > &outputs, GraphRunStats *stats=nullptr) |
|
Begin a fluent PullSession over the given outputs. More... | |
| std::optional< Sample > | pull_any (const std::vector< Output > &outputs, int timeout_ms=-1, GraphRunStats *stats=nullptr, NodeId *out_node=nullptr) |
|
Pull from whichever of outputs produces a sample first. out_node reports the source. More... | |
| bool | warmup (const std::vector< Output > &outputs, int warmup_count, int timeout_ms=-1) |
|
Drain warmup_count samples (one per stream) and discard them. More... | |
| void | pull_until (const std::vector< Output > &outputs, GraphRunStats &stats, const GraphRunPullOptions &opt, const std::function< void(const Sample &, NodeId)> &on_sample={}) |
|
Loop pull_any() until target/stall/max-runtime, optionally invoking on_sample per pull. More... | |
| StallGuard | stall_guard (const std::vector< Output > &outputs, int per_stream_target, int stall_ms, std::vector< std::string > stream_ids={}) |
|
Construct a StallGuard configured for the given outputs. More... | |
| void | emit_rate_summary (const GraphRunStats &stats) const |
|
Print a per-stream rate summary line — for end-of-run logging. More... | |
| void | emit_rate_summary () const |
|
Same as above, using the run's internal stats collector. More... | |
| void | emit_stream_summary (const GraphRunStats &stats) const |
|
Print a per-stream count summary. More... | |
| void | emit_stream_summary () const |
|
Same as above, using the run's internal stats collector. More... | |
| void | emit_summary (const GraphRunStats &stats) const |
|
Print both rate and stream summaries. More... | |
| void | emit_summary () const |
|
Same as above, using the run's internal stats collector. More... | |
| RuntimeMetrics | metrics (const RuntimeMetricsOptions &opt={}) const |
|
Return unified runtime metrics for recorded graph stats. More... | |
| std::string | metrics_report (const RuntimeMetricsOptions &opt={}, RuntimeMetricsFormat format=RuntimeMetricsFormat::Text) const |
|
Render graph metrics in the requested format. More... | |
| std::string | metrics_report (RuntimeMetricsFormat format) const |
|
Convenience overload for selecting the output format with default options. More... | |
| std::string | describe () const |
|
Human-readable description of the runtime graph (for diagnostics). More... | |
| void | stop () |
|
Stop the underlying runtime. Idempotent. More... | |
| std::string | last_error () const |
|
Most recent error message, or empty string if none. More... | |
| void | last_error_or_throw () const |
|
Throw SessionError if last_error() is non-empty. More... | |
Private Member Attributes Index
| std::shared_ptr< State > | state_ |
Description
Live runtime handle for a compiled Graph.
Returned by GraphSession::build(). Move-only (queues, threads, resources are not copyable). Push samples into named-port Input handles, pull from Output handles, use the fluent PullSession for the common collect-until-done workflow.
Definition at line 166 of file GraphRun.h.
Friends
GraphSession
|
Definition at line 392 of file GraphRun.h.
Public Constructors
GraphRun()
| default |
Default-construct an empty (non-running) handle. Useful as a movable placeholder.
Definition at line 305 of file GraphRun.h.
GraphRun()
| delete |
Copy is disabled — GraphRun owns runtime resources and is move-only.
Definition at line 307 of file GraphRun.h.
GraphRun()
| noexcept |
Move-construct, transferring ownership of the underlying runtime.
Definition at line 312 of file GraphRun.h.
Private Constructors
GraphRun()
| explicit |
Definition at line 391 of file GraphRun.h.
Public Destructor
~GraphRun()
|
Destroy the handle, stopping the runtime if still running.
Definition at line 316 of file GraphRun.h.
Public Operators
operator bool()
| explicit noexcept |
True iff this handle owns a live runtime.
Definition at line 319 of file GraphRun.h.
operator=()
| delete |
Copy assignment is disabled — GraphRun is move-only.
Definition at line 309 of file GraphRun.h.
operator=()
| noexcept |
Move-assign, transferring ownership of the underlying runtime.
Definition at line 314 of file GraphRun.h.
Public Member Functions
collect()
|
Begin a fluent PullSession over the given outputs.
Definition at line 343 of file GraphRun.h.
describe()
|
Human-readable description of the runtime graph (for diagnostics).
Definition at line 378 of file GraphRun.h.
emit_rate_summary()
|
Print a per-stream rate summary line — for end-of-run logging.
Definition at line 358 of file GraphRun.h.
emit_rate_summary()
|
Same as above, using the run's internal stats collector.
Definition at line 360 of file GraphRun.h.
emit_stream_summary()
|
Print a per-stream count summary.
Definition at line 362 of file GraphRun.h.
emit_stream_summary()
|
Same as above, using the run's internal stats collector.
Definition at line 364 of file GraphRun.h.
emit_summary()
|
Print both rate and stream summaries.
Definition at line 366 of file GraphRun.h.
emit_summary()
|
Same as above, using the run's internal stats collector.
Definition at line 368 of file GraphRun.h.
enable_stats()
|
Lazily allocate and return a stats collector tied to this run.
Definition at line 339 of file GraphRun.h.
input()
|
Get an Input push handle bound to a node's default input port.
Definition at line 332 of file GraphRun.h.
input()
Get an Input push handle bound to a specific named port on a node.
Definition at line 334 of file GraphRun.h.
last_error()
|
Most recent error message, or empty string if none.
Definition at line 383 of file GraphRun.h.
last_error_or_throw()
|
Throw SessionError if last_error() is non-empty.
Definition at line 385 of file GraphRun.h.
metrics()
|
Return unified runtime metrics for recorded graph stats.
Definition at line 370 of file GraphRun.h.
metrics_report()
|
Render graph metrics in the requested format.
Definition at line 372 of file GraphRun.h.
metrics_report()
|
Convenience overload for selecting the output format with default options.
Definition at line 375 of file GraphRun.h.
output()
|
Get an Output pull handle for a node.
Definition at line 336 of file GraphRun.h.