summaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/expression/interpolatedlookupfunctionnode.h
blob: 50e03e615a27e38ab09ca7f7a72e65f7dc50ff51 (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
32
33
34
35
36
37
38
39
40
41
42
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include "unaryfunctionnode.h"

namespace search {
    namespace attribute { class IAttributeVector; }

namespace expression {

class InterpolatedLookup : public UnaryFunctionNode
{
public:
    DECLARE_EXPRESSIONNODE(InterpolatedLookup);
    DECLARE_NBO_SERIALIZE;

    InterpolatedLookup();
    ~InterpolatedLookup();

    InterpolatedLookup(const vespalib::string &attribute,
                       ExpressionNode::UP arg);

    InterpolatedLookup(const search::attribute::IAttributeVector &attr,
                       ExpressionNode::UP lookupArg);

    InterpolatedLookup(const InterpolatedLookup &rhs);

    InterpolatedLookup & operator= (const InterpolatedLookup &rhs);

    void setDocId(DocId docId) { _docId = docId; }
private:
    virtual bool onExecute() const;
    virtual void onPrepareResult();
    virtual void wireAttributes(const search::attribute::IAttributeContext &attrCtx);
    vespalib::string _attributeName;
    const search::attribute::IAttributeVector * _attribute;
    DocId _docId;
};

}
}