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

One resolved statement. More...

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

Public Attributes

StepKind kind = StepKind::kPipe
 
std::string label
 The name this step is known by: a bound name, or action/for/if with a #2 after it where one label is used twice.
 
BodyId body = kNone
 
std::vector< StepId > after
 What it waits for.
 
syntax::Location location
 
std::string action
 kCall.
 
std::string mode
 
std::string node_map
 
std::optional< absl::Duration > timeout
 
bool tee = false
 
bool tolerant = false
 
std::vector< std::pair< std::string, ExprId > > headers
 
std::vector< std::string > forward
 
ExprId action_id = kNone
 
absl::flat_hash_map< std::string, RefId > ports
 Every port of this call that the flow wired up, by direction:name.
 
RefId status = kNone
 Its outcome, once something has asked for one.
 
RefId source = kNone
 kPipe reads and writes these refs. kCapture reads source.
 
RefId destination = kNone
 
bool discard = false
 kPipe: -> _, which reads the stream and keeps nothing.
 
std::optional< long long > count
 kSkip: skip n port, which claims no reader slot – the count is applied where the stream is produced and this step has nothing left to do.
 
std::string slot
 kCapture: which slot of the enclosing loop it fills.
 
RefId outcome = kNone
 kWait/kDrain: the outcome read, and whether a bad one is this flow's business or the subject's.
 
std::vector< RefId > subjects
 kWait: the outcomes of a wait first of / wait all of, in the order they were written.
 
bool race = false
 kWait: whether the first subject to finish is enough.
 
RefId winner = kNone
 kWait: the value a race is – which subject won – for whoever reads it.
 
StepId target = kNone
 kCancel: the call to stop.
 
ExprId code = kNone
 kFail.
 
ExprId message = kNone
 
std::string code_name
 The canonical code fail named outright: fail not_found "...".
 
LogTail log
 kLog: the level, the format and what fills it.
 
std::vector< BodyId > bodies
 kForEach, kRepeat, kIf: the bodies nested here, in reading order.
 
RefId item = kNone
 kForEach: the value and the index each pass binds.
 
RefId index = kNone
 
int parallel = 1
 
RefId carry = kNone
 kRepeat: what it carries, where the next pass's value comes from, and when it stops.
 
RefId carry_source = kNone
 
syntax::Constant start
 
std::optional< int > max_iterations
 max n, where one was written; nothing means the loop is bounded only by its condition.
 
ExprId condition = kNone
 
bool stop_when = true
 

Detailed Description

One resolved statement.

Member Data Documentation

◆ action

std::string a11::flow::graph::Step::action

kCall.

◆ action_id

ExprId a11::flow::graph::Step::action_id = kNone

◆ after

std::vector<StepId> a11::flow::graph::Step::after

What it waits for.

◆ bodies

std::vector<BodyId> a11::flow::graph::Step::bodies

kForEach, kRepeat, kIf: the bodies nested here, in reading order.

An if has two; the loops have one.

◆ body

BodyId a11::flow::graph::Step::body = kNone

◆ carry

RefId a11::flow::graph::Step::carry = kNone

kRepeat: what it carries, where the next pass's value comes from, and when it stops.

◆ carry_source

RefId a11::flow::graph::Step::carry_source = kNone

◆ code

ExprId a11::flow::graph::Step::code = kNone

kFail.

◆ code_name

std::string a11::flow::graph::Step::code_name

The canonical code fail named outright: fail not_found "...".

Kept apart from code because a written-out name is not an expression – nothing in scope is called not_found – and the runtime should not have to decide which of the two a bare word was. Where this is set, code is not.

◆ condition

ExprId a11::flow::graph::Step::condition = kNone

◆ count

std::optional<long long> a11::flow::graph::Step::count

kSkip: skip n port, which claims no reader slot – the count is applied where the stream is produced and this step has nothing left to do.

◆ destination

RefId a11::flow::graph::Step::destination = kNone

◆ discard

bool a11::flow::graph::Step::discard = false

kPipe: -> _, which reads the stream and keeps nothing.

The opposite end of the language from a counted skip: that one is elided, because the values were already taken where the stream is produced and the step has nothing left to do. A discard is performed – every stage on the pipeline runs, and the values are dropped only once there is nowhere left for them to go. So this is a step with a reader slot (see [FlowGraph::Sources]) and no destination at all: destination is kNone, nothing counts as a writer of anything, and no data is kept.

◆ forward

std::vector<std::string> a11::flow::graph::Step::forward

◆ headers

std::vector<std::pair<std::string, ExprId> > a11::flow::graph::Step::headers

◆ index

RefId a11::flow::graph::Step::index = kNone

◆ item

RefId a11::flow::graph::Step::item = kNone

kForEach: the value and the index each pass binds.

◆ kind

StepKind a11::flow::graph::Step::kind = StepKind::kPipe

◆ label

std::string a11::flow::graph::Step::label

The name this step is known by: a bound name, or action/for/if with a #2 after it where one label is used twice.

◆ location

syntax::Location a11::flow::graph::Step::location

◆ log

LogTail a11::flow::graph::Step::log

kLog: the level, the format and what fills it.

◆ max_iterations

std::optional<int> a11::flow::graph::Step::max_iterations

max n, where one was written; nothing means the loop is bounded only by its condition.

See [syntax::Repeat::max_iterations].

◆ message

ExprId a11::flow::graph::Step::message = kNone

◆ mode

std::string a11::flow::graph::Step::mode

◆ node_map

std::string a11::flow::graph::Step::node_map

◆ outcome

RefId a11::flow::graph::Step::outcome = kNone

kWait/kDrain: the outcome read, and whether a bad one is this flow's business or the subject's.

◆ parallel

int a11::flow::graph::Step::parallel = 1

◆ ports

absl::flat_hash_map<std::string, RefId> a11::flow::graph::Step::ports

Every port of this call that the flow wired up, by direction:name.

◆ race

bool a11::flow::graph::Step::race = false

kWait: whether the first subject to finish is enough.

◆ slot

std::string a11::flow::graph::Step::slot

kCapture: which slot of the enclosing loop it fills.

◆ source

RefId a11::flow::graph::Step::source = kNone

kPipe reads and writes these refs. kCapture reads source.

◆ start

syntax::Constant a11::flow::graph::Step::start

◆ status

RefId a11::flow::graph::Step::status = kNone

Its outcome, once something has asked for one.

◆ stop_when

bool a11::flow::graph::Step::stop_when = true

◆ subjects

std::vector<RefId> a11::flow::graph::Step::subjects

kWait: the outcomes of a wait first of / wait all of, in the order they were written.

Empty for the single-subject form, whose one outcome is outcome – which is also the first of these, so anything reading a wait's outcome keeps working without knowing which form it was.

◆ target

StepId a11::flow::graph::Step::target = kNone

kCancel: the call to stop.

◆ tee

bool a11::flow::graph::Step::tee = false

◆ timeout

std::optional<absl::Duration> a11::flow::graph::Step::timeout

◆ tolerant

bool a11::flow::graph::Step::tolerant = false

◆ winner

RefId a11::flow::graph::Step::winner = kNone

kWait: the value a race is – which subject won – for whoever reads it.

kNone where nothing does, and on the forms that have no winner.


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