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

Function ConfigureRuntime

codelab/solutions/exercise10.cc:65–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65absl::StatusOr<std::unique_ptr<cel::Runtime>> ConfigureRuntime() {
66 cel::RuntimeOptions runtime_options;
67 // Note: this is needed to resolve net.Address as a `type` constant.
68 runtime_options.enable_qualified_type_identifiers = true;
69 absl::StatusOr<cel::RuntimeBuilder> runtime_builder =
70 cel::CreateStandardRuntimeBuilder(cel::GetMinimalDescriptorPool(),
71 runtime_options);
72 // ===========================================================================
73 // Codelab: Update runtime builder with functions from network_functions.h
74 // ===========================================================================
75 absl::Status s =
76 RegisterNetworkTypes(runtime_builder->type_registry(), runtime_options);
77 s.Update(RegisterNetworkFunctions(runtime_builder->function_registry(),
78 runtime_options));
79 if (!s.ok()) return s;
80
81 return std::move(runtime_builder).value().Build();
82}
83
84} // namespace
85

Callers 1

Calls 6

RegisterNetworkTypesFunction · 0.85
RegisterNetworkFunctionsFunction · 0.85
okMethod · 0.45
BuildMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected