forked from cel-expr/cel-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexpression_step_base.h
More file actions
38 lines (28 loc) · 1017 Bytes
/
Copy pathexpression_step_base.h
File metadata and controls
38 lines (28 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef THIRD_PARTY_CEL_CPP_EVAL_EVAL_EXPRESSION_STEP_BASE_H_
#define THIRD_PARTY_CEL_CPP_EVAL_EVAL_EXPRESSION_STEP_BASE_H_
#include <stdint.h>
#include "eval/eval/evaluator_core.h"
namespace google {
namespace api {
namespace expr {
namespace runtime {
class ExpressionStepBase : public ExpressionStep {
public:
explicit ExpressionStepBase(int64_t expr_id, bool comes_from_ast = true)
: id_(expr_id), comes_from_ast_(comes_from_ast) {}
// Non-copyable
ExpressionStepBase(const ExpressionStepBase&) = delete;
ExpressionStepBase& operator=(const ExpressionStepBase&) = delete;
// Returns corresponding expression object ID.
int64_t id() const override { return id_; }
// Returns if the execution step comes from AST.
bool ComesFromAst() const override { return comes_from_ast_; }
private:
int64_t id_;
bool comes_from_ast_;
};
} // namespace runtime
} // namespace expr
} // namespace api
} // namespace google
#endif // THIRD_PARTY_CEL_CPP_EVAL_EVAL_EXPRESSION_STEP_BASE_H_