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

#include "bitfunctionnode.h"
#include "integerresultnode.h"

namespace search {
namespace expression {

class AndFunctionNode : public BitFunctionNode
{
public:
    DECLARE_EXPRESSIONNODE(AndFunctionNode);
    AndFunctionNode() { }
private:
    ResultNode::CP getInitialValue() const override { return  ResultNode::CP(new Int64ResultNode(-1)); }
    ResultNode & flatten(const ResultNodeVector & v, ResultNode & result) const override { return v.flattenAnd(result); }
    void onArgument(const ResultNode & arg, Int64ResultNode & result) const override;
};

}
}