iceberg-cpp
Loading...
Searching...
No Matches
rewrite_not.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20#pragma once
21
24
25#include <memory>
26
28
29namespace iceberg {
30
31class ICEBERG_EXPORT RewriteNot : public ExpressionVisitor<std::shared_ptr<Expression>> {
32 public:
33 static Result<std::shared_ptr<Expression>> Visit(std::shared_ptr<Expression> expr);
34
35 Result<std::shared_ptr<Expression>> AlwaysTrue() override;
36 Result<std::shared_ptr<Expression>> AlwaysFalse() override;
37 Result<std::shared_ptr<Expression>> Not(
38 const std::shared_ptr<Expression>& child_result) override;
39 Result<std::shared_ptr<Expression>> And(
40 const std::shared_ptr<Expression>& left_result,
41 const std::shared_ptr<Expression>& right_result) override;
42 Result<std::shared_ptr<Expression>> Or(
43 const std::shared_ptr<Expression>& left_result,
44 const std::shared_ptr<Expression>& right_result) override;
45 Result<std::shared_ptr<Expression>> Predicate(
46 const std::shared_ptr<BoundPredicate>& pred) override;
47 Result<std::shared_ptr<Expression>> Predicate(
48 const std::shared_ptr<UnboundPredicate>& pred) override;
49};
50
51} // namespace iceberg
An Expression that represents a logical AND operation between two expressions.
Definition expression.h:139
Base visitor for traversing expression trees.
Definition expression_visitor.h:49
An Expression that represents logical NOT operation.
Definition expression.h:289
An Expression that represents a logical OR operation between two expressions.
Definition expression.h:215
A predicate is a boolean expression that tests a term against some criteria.
Definition predicate.h:38
Definition rewrite_not.h:31
Result< R > Visit(const std::shared_ptr< Expression > &expr, V &visitor)
Traverse an expression tree with a visitor.
Definition expression_visitor.h:283