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

Function UnwrapMessageToValue

eval/public/structs/cel_proto_wrap_util.cc:1455–1469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1453} // namespace
1454
1455CelValue UnwrapMessageToValue(const google::protobuf::Message* value,
1456 const ProtobufValueFactory& factory,
1457 Arena* arena) {
1458 // Messages are Nullable types
1459 if (value == nullptr) {
1460 return CelValue::CreateNull();
1461 }
1462
1463 absl::optional<CelValue> special_value =
1464 ValueFromMessageMaker::CreateValue(value, factory, arena);
1465 if (special_value.has_value()) {
1466 return *special_value;
1467 }
1468 return factory(value);
1469}
1470
1471const google::protobuf::Message* MaybeWrapValueToMessage(
1472 const google::protobuf::Descriptor* descriptor, google::protobuf::MessageFactory* factory,

Callers 7

TEST_FFunction · 0.85
ValueFromAnyMethod · 0.85
CreateMessageMethod · 0.85

Calls 2

CreateValueFunction · 0.85
has_valueMethod · 0.45

Tested by 3

TEST_FFunction · 0.68