Coverage Report

Created: 2026-11-12 06:42

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/proc/self/cwd/eval/eval/expression_step_logic.h
Line
Count
Source
1
// Copyright 2026 Google LLC
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
//     https://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
#ifndef THIRD_PARTY_CEL_CPP_EVAL_EVAL_EXPRESSION_STEP_LOGIC_H_
16
#define THIRD_PARTY_CEL_CPP_EVAL_EVAL_EXPRESSION_STEP_LOGIC_H_
17
18
#include "common/native_type.h"
19
20
namespace google::api::expr::runtime {
21
22
class ExecutionFrame;
23
24
// ExpressionStepLogic is the base class for generic expression steps that are
25
// not implemented directly in the evaluator core.
26
class ExpressionStepLogic {
27
 public:
28
29.8k
  virtual ~ExpressionStepLogic() = default;
29
30
  // Performs actual evaluation.
31
  // Values are passed between Expression objects via EvaluatorStack, which is
32
  // supplied with context.
33
  // Also, Expression gets values supplied by caller though Activation
34
  // interface.
35
  // ExpressionStep instances can in specific cases
36
  // modify execution order(perform jumps).
37
  //
38
  // Unrecoverable errors are reported via ExecutionFrame::Abort.
39
  virtual void Evaluate(ExecutionFrame* frame) const = 0;
40
41
  // Return the type of the underlying expression step for special handling in
42
  // the planning phase. This should only be overridden by special cases, and
43
  // callers must not make any assumptions about the default case.
44
0
  virtual cel::NativeTypeId GetNativeTypeId() const {
45
0
    return cel::NativeTypeId();
46
0
  }
47
};
48
49
}  // namespace google::api::expr::runtime
50
51
#endif  // THIRD_PARTY_CEL_CPP_EVAL_EVAL_EXPRESSION_STEP_LOGIC_H_