aboutsummaryrefslogtreecommitdiffstats
path: root/searchsummary/src/vespa/searchsummary/docsummary/res_config_entry.h
blob: e8d6c9f4e73308a601505d9f8afe7f60895d1e61 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/vespalib/stllike/string.h>
#include <memory>

namespace search::docsummary {

class DocsumFieldWriter;

/**
 * This struct describes a single docsum field (name and type).
 **/
class ResConfigEntry {
private:
    vespalib::string _name;
    std::unique_ptr<DocsumFieldWriter> _writer;
    bool _generated;
public:
    ResConfigEntry(const vespalib::string& name_in) noexcept;
    ~ResConfigEntry();
    ResConfigEntry(ResConfigEntry&&) noexcept;
    void set_writer(std::unique_ptr<DocsumFieldWriter> writer);
    const vespalib::string& name() const { return _name; }
    DocsumFieldWriter* writer() const { return _writer.get(); }
    bool is_generated() const { return _generated; }
};

}