A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
Loading...
Searching...
No Matches
a11::flow::graph::GraphBuilder Class Reference

Appends to a [FlowGraph] while the resolver walks a flow. More...

#include <cpp/a11/flow/graph.h>

Public Member Functions

 GraphBuilder (FlowGraph &flow)
 
FlowGraph & flow ()
 
BodyId AddBody (std::string label, BodyId parent=kNone, StepId owner_step=kNone)
 
bool Carries (RefId ref) const
 Whether the ref already in the graph carries at most one value.
 
RefId AddRef (Ref ref)
 Appends a ref and derives cardinality from its kind and sources.
 
StepId AddStep (Step step)
 Append a step, and record it in the body it belongs to.
 
ExprId AddExpr (Expr expr)
 
Ref & ref (RefId id)
 
Step & step (StepId id)
 
Expr & expr (ExprId id)
 

Static Public Member Functions

static bool StageMakesOne (const Stage &stage)
 Whether a stage reduces its input to one value, including first 1.
 
static bool StagePreservesCount (const Stage &stage)
 Whether a stage produces at most one output per input value.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ GraphBuilder()

a11::flow::graph::GraphBuilder::GraphBuilder ( FlowGraph &  flow)
inlineexplicit

Member Function Documentation

◆ AddBody()

BodyId a11::flow::graph::GraphBuilder::AddBody ( std::string  label,
BodyId  parent = kNone,
StepId  owner_step = kNone 
)
inline

◆ AddExpr()

ExprId a11::flow::graph::GraphBuilder::AddExpr ( Expr  expr)
inline

◆ AddRef()

RefId a11::flow::graph::GraphBuilder::AddRef ( Ref  ref)
inline

Appends a ref and derives cardinality from its kind and sources.

Declared ports retain their supplied cardinality.

◆ 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 reduces its input to one value, including first 1.

◆ StagePreservesCount()

static bool a11::flow::graph::GraphBuilder::StagePreservesCount ( const Stage &  stage)
inlinestatic

Whether a stage produces at most one output per input value.

Unknown stages default to false.

◆ step()

Step & a11::flow::graph::GraphBuilder::step ( StepId  id)
inline

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