aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/aggregation/modifiers.h
blob: add05becfa903eb944b587df102de1330f408b57 (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
25
26
27
28
29
30
31
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include <vespa/vespalib/objects/objectoperation.h>
#include <vespa/vespalib/objects/objectpredicate.h>
#include <memory>

namespace search::expression {

class ExpressionNode;
class AttributeNode;

}

namespace search::aggregation {

class AttributeNodeReplacer : public vespalib::ObjectOperation, public vespalib::ObjectPredicate
{
private:
    void execute(vespalib::Identifiable &obj) override;
    bool check(const vespalib::Identifiable &obj) const override;
    virtual std::unique_ptr<search::expression::ExpressionNode> getReplacementNode(const search::expression::AttributeNode &attributeNode) = 0;
};

class Attribute2DocumentAccessor : public AttributeNodeReplacer
{
private:
    std::unique_ptr<search::expression::ExpressionNode> getReplacementNode(const search::expression::AttributeNode &attributeNode) override;
};

}