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

Function GetFieldValue

extensions/protobuf/bind_proto_to_activation.cc:45–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45absl::StatusOr<Value> GetFieldValue(
46 const google::protobuf::FieldDescriptor* field_desc, const StructValue& struct_value,
47 const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool,
48 google::protobuf::MessageFactory* absl_nonnull message_factory,
49 google::protobuf::Arena* absl_nonnull arena) {
50 // Special case unset any.
51 if (field_desc->cpp_type() == google::protobuf::FieldDescriptor::CPPTYPE_MESSAGE &&
52 field_desc->message_type()->well_known_type() ==
53 Descriptor::WELLKNOWNTYPE_ANY) {
54 CEL_ASSIGN_OR_RETURN(bool present,
55 struct_value.HasFieldByNumber(field_desc->number()));
56 if (!present) {
57 return NullValue();
58 }
59 }
60
61 return struct_value.GetFieldByNumber(field_desc->number(), descriptor_pool,
62 message_factory, arena);
63}
64
65} // namespace
66

Callers

nothing calls this directly

Calls 3

numberMethod · 0.80
NullValueClass · 0.50
GetFieldByNumberMethod · 0.45

Tested by

no test coverage detected