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

Method FindVariable

eval/internal/adapter_activation_impl.cc:38–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36using ::google::api::expr::runtime::CelFunction;
37
38absl::StatusOr<bool> AdapterActivationImpl::FindVariable(
39 absl::string_view name,
40 const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool,
41 google::protobuf::MessageFactory* absl_nonnull message_factory,
42 google::protobuf::Arena* absl_nonnull arena, Value* absl_nonnull result) const {
43 // This implementation should only be used during interop, when we can
44 // always assume the memory manager is backed by a protobuf arena.
45
46 absl::optional<google::api::expr::runtime::CelValue> legacy_value =
47 legacy_activation_.FindValue(name, arena);
48 if (!legacy_value.has_value()) {
49 return false;
50 }
51 CEL_RETURN_IF_ERROR(ModernValue(arena, *legacy_value, *result));
52 return true;
53}
54
55std::vector<FunctionOverloadReference>
56AdapterActivationImpl::FindFunctionOverloads(absl::string_view name) const

Callers 1

TEST_FFunction · 0.45

Calls 3

FindValueMethod · 0.80
ModernValueFunction · 0.50
has_valueMethod · 0.45

Tested by 1

TEST_FFunction · 0.36