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

Method Evaluate

eval/eval/function_step.cc:435–472  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

433 resolver_(std::forward<Resolver>(resolver)) {}
434
435 absl::Status Evaluate(ExecutionFrameBase& frame, cel::Value& result,
436 AttributeTrail& trail) const override {
437 absl::InlinedVector<Value, 2> args;
438 absl::InlinedVector<AttributeTrail, 2> arg_trails;
439
440 args.resize(arg_steps_.size());
441 arg_trails.resize(arg_steps_.size());
442
443 for (size_t i = 0; i < arg_steps_.size(); i++) {
444 CEL_RETURN_IF_ERROR(
445 arg_steps_[i]->Evaluate(frame, args[i], arg_trails[i]));
446 }
447
448 if (frame.unknown_processing_enabled()) {
449 for (size_t i = 0; i < arg_trails.size(); i++) {
450 if (frame.attribute_utility().CheckForUnknown(arg_trails[i],
451 /*use_partial=*/true)) {
452 args[i] = frame.attribute_utility().CreateUnknownSet(
453 arg_trails[i].attribute());
454 }
455 }
456 }
457
458 CEL_ASSIGN_OR_RETURN(ResolveResult resolved_function,
459 resolver_.Resolve(frame, args));
460
461 if (resolved_function.has_value() &&
462 ShouldAcceptOverload(resolved_function->descriptor, args)) {
463 CEL_ASSIGN_OR_RETURN(result,
464 Invoke(*resolved_function, expr_id_, args, frame));
465
466 return absl::OkStatus();
467 }
468
469 result = NoOverloadResult(name_, args, receiver_style_, frame);
470
471 return absl::OkStatus();
472 }
473
474 absl::optional<std::vector<const DirectExpressionStep*>> GetDependencies()
475 const override {

Callers

nothing calls this directly

Calls 11

ShouldAcceptOverloadFunction · 0.85
InvokeFunction · 0.85
NoOverloadResultFunction · 0.85
attributeMethod · 0.80
CEL_ASSIGN_OR_RETURNFunction · 0.70
sizeMethod · 0.45
EvaluateMethod · 0.45
CheckForUnknownMethod · 0.45
CreateUnknownSetMethod · 0.45
has_valueMethod · 0.45

Tested by

no test coverage detected