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

Function CreateValueFromField

eval/public/activation_bind_helper.cc:20–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18using google::protobuf::Descriptor;
19
20absl::Status CreateValueFromField(const google::protobuf::Message* msg,
21 const FieldDescriptor* field_desc,
22 google::protobuf::Arena* arena, CelValue* result) {
23 if (field_desc->is_map()) {
24 *result = CelValue::CreateMap(google::protobuf::Arena::Create<FieldBackedMapImpl>(
25 arena, msg, field_desc, arena));
26 return absl::OkStatus();
27 } else if (field_desc->is_repeated()) {
28 *result = CelValue::CreateList(google::protobuf::Arena::Create<FieldBackedListImpl>(
29 arena, msg, field_desc, arena));
30 return absl::OkStatus();
31 } else {
32 return CreateValueFromSingleField(msg, field_desc, arena, result);
33 }
34}
35
36} // namespace
37

Callers 1

BindProtoToActivationFunction · 0.85

Calls 3

CreateMapFunction · 0.50
CreateListFunction · 0.50

Tested by

no test coverage detected