@@ -159,22 +159,6 @@ struct ToArgsHelper {
159159 }
160160};
161161
162- class FunctionAdapterBase : public Function {
163- public:
164- using Function::Invoke;
165-
166- // Should not be called by CEL, but added for backward compatibility for
167- // client code tests.
168- absl::StatusOr<Value> Invoke (
169- absl::Span<const Value> args,
170- const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool,
171- google::protobuf::MessageFactory* absl_nonnull message_factory,
172- google::protobuf::Arena* absl_nonnull arena) const final {
173- Function::InvokeContext context (descriptor_pool, message_factory, arena);
174- return Invoke (args, context);
175- }
176- };
177-
178162} // namespace runtime_internal
179163
180164// Adapter class for generating CEL extension functions from a one argument
@@ -247,12 +231,12 @@ class NullaryFunctionAdapter
247231 }
248232
249233 private:
250- class UnaryFunctionImpl : public runtime_internal ::FunctionAdapterBase {
234+ class UnaryFunctionImpl : public Function {
251235 public:
252236 explicit UnaryFunctionImpl (FunctionType fn) : fn_(std::move(fn)) {}
253237 absl::StatusOr<Value> Invoke (
254238 absl::Span<const Value> args,
255- const Function::InvokeContext& context) const override {
239+ const Function::InvokeContext& context) const final {
256240 if (args.size () != 0 ) {
257241 return absl::InvalidArgumentError (
258242 " unexpected number of arguments for nullary function" );
@@ -346,12 +330,12 @@ class UnaryFunctionAdapter : public RegisterHelper<UnaryFunctionAdapter<T, U>> {
346330 }
347331
348332 private:
349- class UnaryFunctionImpl : public runtime_internal ::FunctionAdapterBase {
333+ class UnaryFunctionImpl : public Function {
350334 public:
351335 explicit UnaryFunctionImpl (FunctionType fn) : fn_(std::move(fn)) {}
352336 absl::StatusOr<Value> Invoke (
353337 absl::Span<const Value> args,
354- const Function::InvokeContext& context) const override {
338+ const Function::InvokeContext& context) const final {
355339 using ArgTraits = runtime_internal::AdaptedTypeTraits<U>;
356340 if (args.size () != 1 ) {
357341 return absl::InvalidArgumentError (
@@ -497,12 +481,12 @@ class BinaryFunctionAdapter
497481 }
498482
499483 private:
500- class BinaryFunctionImpl : public runtime_internal ::FunctionAdapterBase {
484+ class BinaryFunctionImpl : public Function {
501485 public:
502486 explicit BinaryFunctionImpl (FunctionType fn) : fn_(std::move(fn)) {}
503487 absl::StatusOr<Value> Invoke (
504488 absl::Span<const Value> args,
505- const Function::InvokeContext& context) const override {
489+ const Function::InvokeContext& context) const final {
506490 using Arg1Traits = runtime_internal::AdaptedTypeTraits<U>;
507491 using Arg2Traits = runtime_internal::AdaptedTypeTraits<V>;
508492 if (args.size () != 2 ) {
@@ -588,12 +572,12 @@ class TernaryFunctionAdapter
588572 }
589573
590574 private:
591- class TernaryFunctionImpl : public runtime_internal ::FunctionAdapterBase {
575+ class TernaryFunctionImpl : public Function {
592576 public:
593577 explicit TernaryFunctionImpl (FunctionType fn) : fn_(std::move(fn)) {}
594578 absl::StatusOr<Value> Invoke (
595579 absl::Span<const Value> args,
596- const Function::InvokeContext& context) const override {
580+ const Function::InvokeContext& context) const final {
597581 using Arg1Traits = runtime_internal::AdaptedTypeTraits<U>;
598582 using Arg2Traits = runtime_internal::AdaptedTypeTraits<V>;
599583 using Arg3Traits = runtime_internal::AdaptedTypeTraits<W>;
@@ -684,12 +668,12 @@ class QuaternaryFunctionAdapter
684668 }
685669
686670 private:
687- class QuaternaryFunctionImpl : public runtime_internal ::FunctionAdapterBase {
671+ class QuaternaryFunctionImpl : public Function {
688672 public:
689673 explicit QuaternaryFunctionImpl (FunctionType fn) : fn_(std::move(fn)) {}
690674 absl::StatusOr<Value> Invoke (
691675 absl::Span<const Value> args,
692- const Function::InvokeContext& context) const override {
676+ const Function::InvokeContext& context) const final {
693677 using Arg1Traits = runtime_internal::AdaptedTypeTraits<U>;
694678 using Arg2Traits = runtime_internal::AdaptedTypeTraits<V>;
695679 using Arg3Traits = runtime_internal::AdaptedTypeTraits<W>;
@@ -807,7 +791,7 @@ class NaryFunctionAdapter
807791 }
808792
809793 private:
810- class NaryFunctionImpl : public runtime_internal ::FunctionAdapterBase {
794+ class NaryFunctionImpl : public Function {
811795 private:
812796 using ArgBuffer = std::tuple<
813797 typename runtime_internal::AdaptedTypeTraits<Args>::AssignableType...>;
@@ -816,7 +800,7 @@ class NaryFunctionAdapter
816800 explicit NaryFunctionImpl (FunctionType fn) : fn_(std::move(fn)) {}
817801 absl::StatusOr<Value> Invoke (
818802 absl::Span<const Value> args,
819- const Function::InvokeContext& context) const override {
803+ const Function::InvokeContext& context) const final {
820804 if (args.size () != sizeof ...(Args)) {
821805 return absl::InvalidArgumentError (
822806 absl::StrCat (" unexpected number of arguments for " , sizeof ...(Args),
0 commit comments