Appends to a [FlowGraph] while the resolver walks a flow.
More...
#include <cpp/a11/flow/graph.h>
|
| static bool | StageMakesOne (const Stage &stage) |
| | Whether a stage yields exactly one value however many it was given.
|
| |
| static bool | StagePreservesCount (const Stage &stage) |
| | Whether a stage yields one value per value it was given.
|
| |
Appends to a [FlowGraph] while the resolver walks a flow.
Keeps step allocation and insertion into the owning body in one operation. The resolver omits this builder on editor-only paths that do not need an executable graph.
◆ GraphBuilder()
| a11::flow::graph::GraphBuilder::GraphBuilder |
( |
FlowGraph & |
flow | ) |
|
|
inlineexplicit |
◆ AddBody()
◆ AddExpr()
| ExprId a11::flow::graph::GraphBuilder::AddExpr |
( |
Expr |
expr | ) |
|
|
inline |
◆ AddRef()
| RefId a11::flow::graph::GraphBuilder::AddRef |
( |
Ref |
ref | ) |
|
|
inline |
Append a ref, working out what it carries.
Unarity is settled here rather than at each of the dozen places a ref is made, because it is a property of the shape of the ref for every kind but the two that name a declared port – and a kind added to the language then gets an answer by default instead of silently keeping whatever the struct's initialiser said.
◆ AddStep()
| StepId a11::flow::graph::GraphBuilder::AddStep |
( |
Step |
step | ) |
|
|
inline |
Append a step, and record it in the body it belongs to.
◆ Carries()
| bool a11::flow::graph::GraphBuilder::Carries |
( |
RefId |
ref | ) |
const |
|
inline |
Whether the ref already in the graph carries at most one value.
◆ expr()
| Expr & a11::flow::graph::GraphBuilder::expr |
( |
ExprId |
id | ) |
|
|
inline |
◆ flow()
| FlowGraph & a11::flow::graph::GraphBuilder::flow |
( |
| ) |
|
|
inline |
◆ ref()
| Ref & a11::flow::graph::GraphBuilder::ref |
( |
RefId |
id | ) |
|
|
inline |
◆ StageMakesOne()
| static bool a11::flow::graph::GraphBuilder::StageMakesOne |
( |
const Stage & |
stage | ) |
|
|
inlinestatic |
Whether a stage yields exactly one value however many it was given.
The reducing three, and first 1, which is how a pipeline says "the
value" out loud. Read from [vocabulary::ReducingStages] rather than listed again, so a stage that joins that set is counted here without being taught.
◆ StagePreservesCount()
| static bool a11::flow::graph::GraphBuilder::StagePreservesCount |
( |
const Stage & |
stage | ) |
|
|
inlinestatic |
Whether a stage yields one value per value it was given.
Then one in gives one out. map, at, truncate, text, json, packb and strformat reshape each value; log and logf reshape nothing and pass each value straight on; where, mime and distinct may drop one, which is still at most one out per one in; scan publishes the state it reached at each value, so one in gives exactly one out; batch and group gather several into a list, which is fewer, as is window – its first n - 1 values produce nothing – and chunk and then make more. Anything the language gains is assumed not to preserve the count until it says so, which is the safe direction.
◆ step()
| Step & a11::flow::graph::GraphBuilder::step |
( |
StepId |
id | ) |
|
|
inline |
The documentation for this class was generated from the following file: