17#ifndef A11_FLOW_PLAN_H_
18#define A11_FLOW_PLAN_H_
26#include <absl/base/nullability.h>
27#include <absl/time/time.h>
98 std::string_view field_name)
const;
101 [[nodiscard]] std::vector<std::string>
FieldNames()
const;
144 std::vector<std::vector<StepPlan>>
bodies;
174 [[nodiscard]]
bool HasPort(std::string_view port_name,
180 [[nodiscard]] std::vector<std::string>
PortNames(
198 [[nodiscard]]
const FlowPlan* absl_nullable
Flow(std::string_view
name)
const;
204 [[nodiscard]]
const DtoPlan* absl_nullable
Dto(std::string_view
name)
const;
PortDirection
Which side of the descriptor a port lands on, spelled as the plan spells it.
Definition syntax.h:728
Definition boundary.cc:32
constexpr std::string_view kPlanFormat
The format field of the plan envelope.
Definition plan.h:208
One compiled struct: a shape a port may be typed with.
Definition plan.h:80
std::string description
Definition plan.h:82
const FieldPlan *absl_nullable Field(std::string_view field_name) const
The field of this name, or nullptr.
Definition resolve.cc:3862
std::vector< std::string > FieldNames() const
Every field name, in declaration order, for a message that lists them.
Definition resolve.cc:3872
std::string name
Definition plan.h:81
syntax::Location location
Definition plan.h:94
bool binary
Whether the shape holds bytes anywhere in it, directly or through another shape it names.
Definition plan.h:93
std::vector< FieldPlan > fields
Definition plan.h:83
One field of a struct, resolved.
Definition plan.h:56
syntax::FieldRange range
Definition plan.h:68
std::string pattern
Definition plan.h:69
std::string element
The element type of a list[T], resolved, or empty where it is not a list.
Definition plan.h:62
bool has_default
Definition plan.h:74
std::string name
Definition plan.h:57
std::string element_dto_name
Definition plan.h:65
syntax::Constant default_value
Definition plan.h:73
std::string dto_name
Whether the field, or a list's element, names a declared shape.
Definition plan.h:64
std::vector< syntax::Constant > enumeration
Definition plan.h:71
bool unique
Definition plan.h:67
bool has_pattern
Definition plan.h:70
syntax::Location location
Definition plan.h:76
std::string declared
Definition plan.h:58
bool required
Definition plan.h:66
std::string description
Definition plan.h:75
std::string type
Definition plan.h:59
bool has_enumeration
Definition plan.h:72
One compiled flow: what a caller sees, and what the runtime will do.
Definition plan.h:149
std::vector< HeaderPlan > headers
Definition plan.h:163
bool HasPort(std::string_view port_name, syntax::PortDirection direction) const
Whether a port of this name is declared in that direction.
Definition plan.h:174
syntax::Location location
Definition plan.h:167
std::vector< StepPlan > steps
Definition plan.h:166
std::string description
Definition plan.h:161
bool entry
Whether this is the file's entry point, declared flow { ... }.
Definition plan.h:160
std::vector< PortPlan > ports
Definition plan.h:162
std::vector< std::string > PortNames(syntax::PortDirection direction) const
Every port name in one direction, sorted, for a message that lists them.
Definition resolve.cc:3817
std::vector< std::string > node_maps
The node maps the flow declares, in declaration order.
Definition plan.h:165
std::string name
Empty for the entry flow, which is the one flow that has no name.
Definition plan.h:151
const PortPlan *absl_nullable Port(std::string_view port_name, syntax::PortDirection direction) const
The port with this name and direction, or nullptr.
Definition resolve.cc:3807
One declared port of a flow, resolved.
Definition plan.h:34
bool unary
Definition plan.h:43
std::string description
Definition plan.h:45
syntax::Location location
Definition plan.h:46
syntax::PortDirection direction
Definition plan.h:36
std::string type
What the type is, for the schema a caller sees: a built-in's mimetype or Python type name,...
Definition plan.h:42
bool required
Definition plan.h:44
std::string name
Definition plan.h:35
std::string declared
The type as the flow wrote it, parameters and all: list[string].
Definition plan.h:38
Every flow and shape one source file declares.
Definition plan.h:185
std::string source_name
Definition plan.h:186
const FlowPlan *absl_nullable Flow(std::string_view name) const
The flow of this name, or nullptr.
Definition resolve.cc:3829
const DtoPlan *absl_nullable Dto(std::string_view name) const
The shape of this name, or nullptr.
Definition resolve.cc:3853
std::vector< DtoPlan > dtos
The shapes, in declaration order.
Definition plan.h:194
const FlowPlan *absl_nullable Entry() const
The file's entry point, or nullptr when it declares none.
Definition resolve.cc:3844
std::vector< FlowPlan > flows
Definition plan.h:187
One resolved statement, as the plan format describes it.
Definition plan.h:121
bool tee
Definition plan.h:137
std::string node_map
Definition plan.h:134
std::vector< std::vector< StepPlan > > bodies
Bodies nested in this step, in the order the language reads them: a for or repeat has one,...
Definition plan.h:144
syntax::Location location
Definition plan.h:145
std::string action
For a call: the action, the verb, and where it goes.
Definition plan.h:132
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 i...
Definition plan.h:128
std::optional< absl::Duration > timeout
Definition plan.h:135
std::string mode
Definition plan.h:133
std::vector< std::string > after
What it waits for, by label.
Definition plan.h:130
std::string destination
Definition plan.h:141
std::string source
For a pipe/skip/wait/drain: what it reads and what it writes, as a reader would say them – search....
Definition plan.h:140
std::string kind
The kind of statement, as a11.flow.plan's Step.kind spells it: call, pipe, skip, wait,...
Definition plan.h:125
bool tolerant
Definition plan.h:136
A value the language can write out in full: what a literal is, and what folding a literal expression ...
Definition syntax.h:80
A bound on a field: 1..200, 1.., ..200.
Definition syntax.h:789
Where a piece of syntax starts, reduced to what every reader of it needs.
Definition syntax.h:49