MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / ConfigureCompiler

Function ConfigureCompiler

codelab/exercise10.cc:44–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42namespace {
43
44absl::StatusOr<std::unique_ptr<cel::Compiler>> ConfigureCompiler() {
45 absl::StatusOr<std::unique_ptr<cel::CompilerBuilder>> compiler_builder =
46 cel::NewCompilerBuilder(cel::GetMinimalDescriptorPool());
47 if (!compiler_builder.ok()) {
48 return std::move(compiler_builder).status();
49 }
50 absl::Status s =
51 (*compiler_builder)->AddLibrary(cel::StandardCompilerLibrary());
52 // ===========================================================================
53 // Codelab: Update compiler builder with functions from network_functions.h
54 // and add a varible for the input IP.
55 // ===========================================================================
56 if (!s.ok()) return s;
57
58 return (*compiler_builder)->Build();
59}
60
61absl::StatusOr<std::unique_ptr<cel::Runtime>> ConfigureRuntime() {
62 cel::RuntimeOptions runtime_options;

Callers 1

Calls 5

StandardCompilerLibraryFunction · 0.85
NewCompilerBuilderFunction · 0.50
okMethod · 0.45
AddLibraryMethod · 0.45
BuildMethod · 0.45

Tested by

no test coverage detected