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 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.
 

Static Public Member Functions

static absl::StatusOr< std::shared_ptr< CompiledProgram > > Compile (std::string source, std::string source_name={})
 Compile source, or fail with the first error the way flow.loads does.
 

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 = {} 
)
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.

◆ 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.

◆ program()

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

◆ source()

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

◆ source_name()

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

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