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

Function DoubleFromValue

eval/public/structs/cel_proto_wrap_util.cc:774–787  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

772}
773
774google::protobuf::Message* DoubleFromValue(const google::protobuf::Message* prototype,
775 const CelValue& value, google::protobuf::Arena* arena) {
776 double val;
777 if (!value.GetValue(&val)) {
778 return nullptr;
779 }
780 auto* message = prototype->New(arena);
781 CEL_ASSIGN_OR_RETURN(
782 auto reflection,
783 cel::well_known_types::GetDoubleValueReflection(message->GetDescriptor()),
784 _.With(IgnoreErrorAndReturnNullptr()));
785 reflection.SetValue(message, val);
786 return message;
787}
788
789google::protobuf::Message* FloatFromValue(const google::protobuf::Message* prototype,
790 const CelValue& value, google::protobuf::Arena* arena) {

Callers 1

MaybeWrapMessageMethod · 0.85

Calls 3

GetValueMethod · 0.45
NewMethod · 0.45
SetValueMethod · 0.45

Tested by

no test coverage detected