aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/common/attributefieldvaluenode.h
blob: 3a83c4aa50f4bca37e88f1ea71f3213046c7f7b5 (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include <vespa/document/select/valuenodes.h>

namespace search { class ReadableAttributeVector; }
namespace proton {

class AttributeFieldValueNode : public document::select::FieldValueNode
{
    using Context = document::select::Context;
    uint32_t _attr_guard_index;

public:
    // Precondition: attribute must be of a single-value type.
    AttributeFieldValueNode(const vespalib::string& doctype,
                            const vespalib::string& field,
                            uint32_t attr_guard_index);

    std::unique_ptr<document::select::Value> getValue(const Context &context) const override;
    std::unique_ptr<document::select::Value> traceValue(const Context &context, std::ostream& out) const override;
    document::select::ValueNode::UP clone() const override;
};

} // namespace proton