aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/query/tree/node.h
blob: 7123d52a50330accd7cf16a38d0cb429cc32e86b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include <memory>

namespace search::query {

struct QueryVisitor;

/**
  This is the base of any node in the query tree. Both leaf nodes (terms)
  and operator nodes (AND, NOT, OR, PHRASE, NEAR, ONEAR, etc).
*/
class Node {
 public:
    using UP = std::unique_ptr<Node>;

    virtual ~Node() = default;
    virtual void accept(QueryVisitor &visitor) = 0;
    virtual bool isIntermediate() const { return false; }
    virtual bool isLocationTerm() const { return false; }
};

}