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

Method Get

common/values/value_builder.cc:443–454  ·  view source on GitHub ↗

Like `operator[](int)` above, but also accepts an arena. Prefer calling this variant if the arena is known.

Source from the content-addressed store, hash-verified

441 // Like `operator[](int)` above, but also accepts an arena. Prefer calling
442 // this variant if the arena is known.
443 CelValue Get(google::protobuf::Arena* arena, int index) const override {
444 if (arena == nullptr) {
445 arena = elements_.get_allocator().arena();
446 }
447 if (ABSL_PREDICT_FALSE(index < 0 || index >= size())) {
448 return CelValue::CreateError(google::protobuf::Arena::Create<absl::Status>(
449 arena, IndexOutOfBoundsError(index).ToStatus()));
450 }
451 return common_internal::UnsafeLegacyValue(
452 elements_[index], /*stable=*/false,
453 arena != nullptr ? arena : elements_.get_allocator().arena());
454 }
455
456 int size() const override { return static_cast<int>(Size()); }
457

Callers

nothing calls this directly

Calls 7

UnsafeLegacyValueFunction · 0.85
IndexOutOfBoundsErrorFunction · 0.70
sizeFunction · 0.50
CreateErrorFunction · 0.50
arenaMethod · 0.45
ToStatusMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected