aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/expression/arrayatlookupfunctionnode.h
blob: c884c6bf1afa3c09e6d4bc0c0af51d98feb271f3 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include "attributenode.h"

namespace search::attribute {
    class IAttributeVector;
    class IAttributeContext;
}

namespace search::expression {

class ArrayAtLookup : public AttributeNode
{
public:
    DECLARE_EXPRESSIONNODE(ArrayAtLookup);
    DECLARE_NBO_SERIALIZE;

    ArrayAtLookup() noexcept;
    ~ArrayAtLookup() override;
    ArrayAtLookup(const vespalib::string &attribute, ExpressionNode::UP arg);
    ArrayAtLookup(const search::attribute::IAttributeVector &attr, ExpressionNode::UP indexArg);
    ArrayAtLookup(const ArrayAtLookup &rhs);
    ArrayAtLookup & operator= (const ArrayAtLookup &rhs);
    bool onExecute() const override;
    void visitMembers(vespalib::ObjectVisitor & visitor) const override;
    void selectMembers(const vespalib::ObjectPredicate & predicate, vespalib::ObjectOperation & operation) override;
private:
    mutable CurrentIndex _currentIndex;
    ExpressionNode::CP   _indexExpression;
};

}