17#ifndef A11_FLOW_CATALOGUE_H_
18#define A11_FLOW_CATALOGUE_H_
25#include <absl/base/nullability.h>
26#include <nlohmann/json_fwd.hpp>
100 [[nodiscard]] std::vector<std::string>
PortNames(
132 std::vector<TypeInfo>
types = {});
148 std::string_view
name)
const;
149 [[nodiscard]]
const TypeInfo* absl_nullable
Type(std::string_view tag)
const;
151 [[nodiscard]]
const std::vector<ActionInfo>&
actions()
const {
155 [[nodiscard]]
const std::vector<TypeInfo>&
types()
const {
return types_; }
158 return actions_.empty() && types_.empty();
161 [[nodiscard]] nlohmann::json
ToJson()
const;
164 std::vector<ActionInfo> actions_;
165 std::vector<TypeInfo> types_;
Everything the tools know about the world, in one place.
Definition catalogue.h:119
bool Empty() const
Definition catalogue.h:157
static Catalogue FromJson(const nlohmann::json &value)
The catalogue value describes, in the shape [ToJson] writes.
Definition catalogue.cc:296
const TypeInfo *absl_nullable Type(std::string_view tag) const
Definition catalogue.cc:415
const ActionInfo *absl_nullable Action(std::string_view name) const
Definition catalogue.cc:406
static Catalogue Of(std::vector< ActionInfo > actions, std::vector< TypeInfo > types={})
The catalogue these entries make.
Definition catalogue.cc:288
const std::vector< TypeInfo > & types() const
Definition catalogue.h:155
const std::vector< ActionInfo > & actions() const
Definition catalogue.h:151
Catalogue MergedWith(const Catalogue &other) const
This catalogue with other laid over it.
Definition catalogue.cc:375
static const Catalogue & Builtin()
The embedded snapshot: what a standalone tool knows with nothing configured.
Definition catalogue.cc:424
nlohmann::json ToJson() const
Definition catalogue.cc:340
std::string value
Definition discover.cc:114
constexpr std::string_view kCatalogueFormat
The format field of the catalogue envelope.
Definition catalogue.h:169
PortDirection
Which side of the descriptor a port lands on, spelled as the plan spells it.
Definition syntax.h:728
Definition boundary.cc:32
One compiled struct: a shape a port may be typed with.
Definition plan.h:80
One action a flow may run or call.
Definition catalogue.h:88
std::string name
Definition catalogue.h:89
std::vector< PortInfo > headers
Header names the action declares, with what each is for.
Definition catalogue.h:94
std::vector< PortInfo > inputs
Definition catalogue.h:91
std::vector< std::string > PortNames(syntax::PortDirection direction) const
Definition catalogue.cc:276
std::string description
Definition catalogue.h:90
std::optional< Origin > origin
Where the declaration is, when it was found by reading source.
Definition catalogue.h:96
std::vector< PortInfo > outputs
Definition catalogue.h:92
const PortInfo *absl_nullable Port(std::string_view port_name, syntax::PortDirection direction) const
Definition catalogue.cc:264
Where an entry was declared, for an entry that was found by reading source.
Definition catalogue.h:63
int column
Definition catalogue.h:70
int line
Definition catalogue.h:69
std::string file
The path as the host gave it to the scanner: absolute if the root was, relative if it was.
Definition catalogue.h:68
friend bool operator==(const Origin &, const Origin &)=default
One port of an action, as a tool needs to show it.
Definition catalogue.h:76
std::string description
Definition catalogue.h:81
std::string type
The type as the action's schema spells it: a Python type name, a serialisation tag,...
Definition catalogue.h:80
std::string name
Definition catalogue.h:77
bool unary
Whether the port carries one value rather than a stream.
Definition catalogue.h:84
bool required
Definition catalogue.h:82
One type the host knows, by the tag a flow writes it as.
Definition catalogue.h:111
std::optional< Origin > origin
Where the declaration is, when it was found by reading source.
Definition catalogue.h:115
DtoPlan shape
Definition catalogue.h:113
std::string tag
Definition catalogue.h:112