Skip to main content

GraphRun Class

Live runtime handle for a compiled Graph. More...

Declaration

class simaai::neat::graph::GraphRun { ... }

Included Headers

#include <GraphRun.h>

Friends Index

classGraphSession

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

boolrunning () const

True iff the underlying graph is currently running. More...

boolpush (NodeId node_id, const Sample &sample)

Push a sample to a node's default input port. Returns false on backpressure timeout. More...

boolpush (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...

Inputinput (NodeId node_id)

Get an Input push handle bound to a node's default input port. More...

Inputinput (NodeId node_id, PortId port)

Get an Input push handle bound to a specific named port on a node. More...

Outputoutput (NodeId node_id)

Get an Output pull handle for a node. More...

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...

PullSessioncollect (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...

boolwarmup (const std::vector< Output > &outputs, int warmup_count, int timeout_ms=-1)

Drain warmup_count samples (one per stream) and discard them. More...

voidpull_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...

StallGuardstall_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...

voidemit_rate_summary (const GraphRunStats &stats) const

Print a per-stream rate summary line — for end-of-run logging. More...

voidemit_rate_summary () const

Same as above, using the run's internal stats collector. More...

voidemit_stream_summary (const GraphRunStats &stats) const

Print a per-stream count summary. More...

voidemit_stream_summary () const

Same as above, using the run's internal stats collector. More...

voidemit_summary (const GraphRunStats &stats) const

Print both rate and stream summaries. More...

voidemit_summary () const

Same as above, using the run's internal stats collector. More...

RuntimeMetricsmetrics (const RuntimeMetricsOptions &opt={}) const

Return unified runtime metrics for recorded graph stats. More...

std::stringmetrics_report (const RuntimeMetricsOptions &opt={}, RuntimeMetricsFormat format=RuntimeMetricsFormat::Text) const

Render graph metrics in the requested format. More...

std::stringmetrics_report (RuntimeMetricsFormat format) const

Convenience overload for selecting the output format with default options. More...

std::stringdescribe () const

Human-readable description of the runtime graph (for diagnostics). More...

voidstop ()

Stop the underlying runtime. Idempotent. More...

std::stringlast_error () const

Most recent error message, or empty string if none. More...

voidlast_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

friend class GraphSession

Definition at line 392 of file GraphRun.h.

392 friend class GraphSession;

Public Constructors

GraphRun()

simaai::neat::graph::GraphRun::GraphRun ()
default

Default-construct an empty (non-running) handle. Useful as a movable placeholder.

Definition at line 305 of file GraphRun.h.

GraphRun()

simaai::neat::graph::GraphRun::GraphRun (const GraphRun &)
delete

Copy is disabled — GraphRun owns runtime resources and is move-only.

Definition at line 307 of file GraphRun.h.

GraphRun()

simaai::neat::graph::GraphRun::GraphRun (GraphRun &&)
noexcept

Move-construct, transferring ownership of the underlying runtime.

Definition at line 312 of file GraphRun.h.

Private Constructors

GraphRun()

simaai::neat::graph::GraphRun::GraphRun (std::shared_ptr< State > state)
explicit

Definition at line 391 of file GraphRun.h.

Public Destructor

~GraphRun()

simaai::neat::graph::GraphRun::~GraphRun ()

Destroy the handle, stopping the runtime if still running.

Definition at line 316 of file GraphRun.h.

Public Operators

operator bool()

simaai::neat::graph::GraphRun::operator bool ()
explicit noexcept

True iff this handle owns a live runtime.

Definition at line 319 of file GraphRun.h.

operator=()

GraphRun & simaai::neat::graph::GraphRun::operator= (const GraphRun &)
delete

Copy assignment is disabled — GraphRun is move-only.

Definition at line 309 of file GraphRun.h.

operator=()

GraphRun & simaai::neat::graph::GraphRun::operator= (GraphRun &&)
noexcept

Move-assign, transferring ownership of the underlying runtime.

Definition at line 314 of file GraphRun.h.

Public Member Functions

collect()

PullSession simaai::neat::graph::GraphRun::collect (const std::vector< Output > & outputs, GraphRunStats * stats=nullptr)

Begin a fluent PullSession over the given outputs.

Definition at line 343 of file GraphRun.h.

describe()

std::string simaai::neat::graph::GraphRun::describe ()

Human-readable description of the runtime graph (for diagnostics).

Definition at line 378 of file GraphRun.h.

emit_rate_summary()

void simaai::neat::graph::GraphRun::emit_rate_summary (const GraphRunStats & stats)

Print a per-stream rate summary line — for end-of-run logging.

Definition at line 358 of file GraphRun.h.

emit_rate_summary()

void simaai::neat::graph::GraphRun::emit_rate_summary ()

Same as above, using the run's internal stats collector.

Definition at line 360 of file GraphRun.h.

emit_stream_summary()

void simaai::neat::graph::GraphRun::emit_stream_summary (const GraphRunStats & stats)

Print a per-stream count summary.

Definition at line 362 of file GraphRun.h.

emit_stream_summary()

void simaai::neat::graph::GraphRun::emit_stream_summary ()

Same as above, using the run's internal stats collector.

Definition at line 364 of file GraphRun.h.

emit_summary()

void simaai::neat::graph::GraphRun::emit_summary (const GraphRunStats & stats)

Print both rate and stream summaries.

Definition at line 366 of file GraphRun.h.

emit_summary()

void simaai::neat::graph::GraphRun::emit_summary ()

Same as above, using the run's internal stats collector.

Definition at line 368 of file GraphRun.h.

enable_stats()

GraphRunStats & simaai::neat::graph::GraphRun::enable_stats ()

Lazily allocate and return a stats collector tied to this run.

Definition at line 339 of file GraphRun.h.

input()

Input simaai::neat::graph::GraphRun::input (NodeId node_id)

Get an Input push handle bound to a node's default input port.

Definition at line 332 of file GraphRun.h.

input()

Input simaai::neat::graph::GraphRun::input (NodeId node_id, PortId port)

Get an Input push handle bound to a specific named port on a node.

Definition at line 334 of file GraphRun.h.

last_error()

std::string simaai::neat::graph::GraphRun::last_error ()

Most recent error message, or empty string if none.

Definition at line 383 of file GraphRun.h.

last_error_or_throw()

void simaai::neat::graph::GraphRun::last_error_or_throw ()

Throw SessionError if last_error() is non-empty.

Definition at line 385 of file GraphRun.h.

metrics()

RuntimeMetrics simaai::neat::graph::GraphRun::metrics (const RuntimeMetricsOptions & opt={})

Return unified runtime metrics for recorded graph stats.

Definition at line 370 of file GraphRun.h.

metrics_report()

std::string simaai::neat::graph::GraphRun::metrics_report (const RuntimeMetricsOptions & opt={}, RuntimeMetricsFormat format=RuntimeMetricsFormat::Text)

Render graph metrics in the requested format.

Definition at line 372 of file GraphRun.h.

metrics_report()

std::string simaai::neat::graph::GraphRun::metrics_report (RuntimeMetricsFormat format)

Convenience overload for selecting the output format with default options.

Definition at line 375 of file GraphRun.h.

output()

Output simaai::neat::graph::GraphRun::output (NodeId node_id)

Get an Output pull handle for a node.

Definition at line 336 of file GraphRun.h.

pull()

std::optional< Sample > simaai::neat::graph::GraphRun::pull (NodeId node_id, int timeout_ms=-1)

Pull from a node's output. timeout_ms < 0 blocks; returns nullopt on timeout.

Definition at line 329 of file GraphRun.h.

pull_any()

std::optional< Sample > simaai::neat::graph::GraphRun::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.

Definition at line 346 of file GraphRun.h.

pull_until()

void simaai::neat::graph::GraphRun::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.

Definition at line 351 of file GraphRun.h.

push()

bool simaai::neat::graph::GraphRun::push (NodeId node_id, const Sample & sample)

Push a sample to a node's default input port. Returns false on backpressure timeout.

Definition at line 324 of file GraphRun.h.

push()

bool simaai::neat::graph::GraphRun::push (NodeId node_id, PortId port, const Sample & sample)

Push a sample to a specific named port on a node.

Definition at line 326 of file GraphRun.h.

running()

bool simaai::neat::graph::GraphRun::running ()

True iff the underlying graph is currently running.

Definition at line 321 of file GraphRun.h.

stall_guard()

StallGuard simaai::neat::graph::GraphRun::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.

Definition at line 355 of file GraphRun.h.

stats()

const GraphRunStats * simaai::neat::graph::GraphRun::stats ()

Read the stats collector, if enable_stats() was called; else nullptr.

Definition at line 341 of file GraphRun.h.

stop()

void simaai::neat::graph::GraphRun::stop ()

Stop the underlying runtime. Idempotent.

Definition at line 381 of file GraphRun.h.

warmup()

bool simaai::neat::graph::GraphRun::warmup (const std::vector< Output > & outputs, int warmup_count, int timeout_ms=-1)

Drain warmup_count samples (one per stream) and discard them.

Definition at line 349 of file GraphRun.h.

Private Member Attributes

state_

std::shared_ptr<State> simaai::neat::graph::GraphRun::state_

Definition at line 389 of file GraphRun.h.

389 std::shared_ptr<State> state_;

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.