Contents

class

SushiRuntime::RunHandle

template <class Owner>

Owns a step that was started but not yet waited for, and finishes it on destruction.

Declared in
include/SushiRuntime/api/graph/run_handle.hpp

Template parameters

Owner

The graph type that produced this handle: Graph or DynamicGraph.

See also

include/SushiRuntime/api/graph/README.md

Public member functions

RunHandle()=default

Constructs an empty handle that owns no step.

RunHandle(RunHandle &&other) noexcept

Takes over other's pending step, leaving it empty.

Parameters

other

Handle to take the step from; owns nothing afterwards.

RunHandle(const RunHandle &)=delete
RunHandle & operator=(RunHandle &&other) noexcept

Settles this handle's own step, then takes over other's.

See also

include/SushiRuntime/api/graph/README.md

RunHandle & operator=(const RunHandle &)=delete
~RunHandle()

Waits for an unwaited step, discarding its outcome.

bool pending() const noexcept

Whether this handle still owns a step that must be waited for.

Returns

True until wait()/try_wait() consumes it, or it is moved from.

bool ready() const

Returns whether waiting would return immediately.

Returns

True when the step is done, or the handle owns no step.

See also

include/SushiRuntime/api/graph/README.md

Core::RunReport wait()

Blocks until the step finishes, advances every State and returns the report.

Exceptions

Core::SushiException

If the handle owns no step.

The

first exception a task threw during the step.

See also

include/SushiRuntime/api/graph/README.md

Core::RunReport & wait(Core::RunReport &reuse)

Blocks until the step finishes and reports into reuse.

Parameters

reuse

The report to overwrite; its previous contents are lost.

Exceptions

Core::SushiException

If the handle owns no step.

The

first exception a task threw during the step.

See also

include/SushiRuntime/api/graph/README.md

Core::Result< Core::RunReport, Core::Error > try_wait() noexcept

Non-throwing wait.

The counterpart to try_run() for the asynchronous path: the same failures, reported as a value.

Returns

The report on success, or the error that ended the step.

Core::Result< Core::RunReport *, Core::Error > try_wait(Core::RunReport &reuse) noexcept

Non-throwing wait into a report the caller owns.

Parameters

reuse

The report to overwrite; its previous contents are lost.

Returns

A pointer to reuse on success, or the error that ended the step.