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

One flow file, compiled: the plans, the graphs, and the tree they borrow. More...

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

Public Member Functions

const Program & program () const
 
const std::string & source () const
 
const std::string & source_name () const
 
const std::vector< Diagnostic > & diagnostics () const
 
const std::vector< ResolvedFlow > & flows () const
 The flows in the order they were declared.
 
const SingleItemAnalysis *absl_nullable SingleItems (std::string_view flow) const
 Verified transport evidence for an enabled compilation, or nullptr.
 
nlohmann::json Optimizations () const
 Explain this compilation's transport choices using the native envelope.
 
std::vector< std::string > ExternalActions () const
 Runtime identities of external actions called by this composition.
 
const ResolvedFlow *absl_nullable Flow (std::string_view name) const
 The flow of this name, or nullptr. Never the entry flow.
 
const ResolvedFlow *absl_nullable Entry () const
 The file's entry point – flow { ... } – or nullptr.
 
const PreparedExpressions & prepared () const
 

Static Public Member Functions

static absl::StatusOr< std::shared_ptr< CompiledProgram > > Compile (std::string source, std::string source_name={}, const ModuleSources &modules={}, ModuleResolver resolver={}, CompilationLimits limits={}, bool single_item_slots=true)
 Compile source, or fail with the first error the way flow.loads does.
 

Friends

struct RuntimeAccess
 

Detailed Description

One flow file, compiled: the plans, the graphs, and the tree they borrow.

A graph points into the parse tree it was resolved from, so the two have one owner and one lifetime. Held by shared_ptr because a registered flow's handler outlives whatever compiled it – register the flows and drop the program, and the handlers still work.

Member Function Documentation

◆ Compile()

absl::StatusOr< std::shared_ptr< CompiledProgram > > a11::flow::CompiledProgram::Compile ( std::string  source,
std::string  source_name = {},
const ModuleSources &  modules = {},
ModuleResolver  resolver = {},
CompilationLimits  limits = {},
bool  single_item_slots = true 
)
static

Compile source, or fail with the first error the way flow.loads does.

The strict door: the parser and the resolver both recover and report everything, and this turns the first Severity::kError into a status with the line and column on it. Everything less than an error is kept for a caller that wants to see it.

◆ diagnostics()

const std::vector< Diagnostic > & a11::flow::CompiledProgram::diagnostics ( ) const
inline

◆ Entry()

const ResolvedFlow *absl_nullable a11::flow::CompiledProgram::Entry ( ) const

The file's entry point – flow { ... } – or nullptr.

◆ ExternalActions()

std::vector< std::string > a11::flow::CompiledProgram::ExternalActions ( ) const

Runtime identities of external actions called by this composition.

◆ Flow()

const ResolvedFlow *absl_nullable a11::flow::CompiledProgram::Flow ( std::string_view  name) const

The flow of this name, or nullptr. Never the entry flow.

◆ flows()

const std::vector< ResolvedFlow > & a11::flow::CompiledProgram::flows ( ) const
inline

The flows in the order they were declared.

◆ Optimizations()

nlohmann::json a11::flow::CompiledProgram::Optimizations ( ) const

Explain this compilation's transport choices using the native envelope.

◆ prepared()

const PreparedExpressions & a11::flow::CompiledProgram::prepared ( ) const
inline

◆ program()

const Program & a11::flow::CompiledProgram::program ( ) const
inline

◆ SingleItems()

const SingleItemAnalysis * a11::flow::CompiledProgram::SingleItems ( std::string_view  flow) const

Verified transport evidence for an enabled compilation, or nullptr.

◆ source()

const std::string & a11::flow::CompiledProgram::source ( ) const
inline

◆ source_name()

const std::string & a11::flow::CompiledProgram::source_name ( ) const
inline

Friends And Related Symbol Documentation

◆ RuntimeAccess

friend struct RuntimeAccess
friend

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