aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/attribute/attribute_spec.h
blob: 8b63837b69aa7997223e2325c4beca24f819cf2a (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 <vespa/vespalib/stllike/string.h>
#include <memory>

namespace search::attribute { class Config; }

namespace proton {

/**
 * A specification of an attribute vector an attribute manager should
 * instantiate and manage.
 */
class AttributeSpec
{
private:
    using Config = search::attribute::Config;
    vespalib::string _name;
    std::unique_ptr<Config> _cfg;
public:
    AttributeSpec(const vespalib::string &name, const search::attribute::Config &cfg);
    AttributeSpec(AttributeSpec &&) noexcept;
    AttributeSpec & operator=(AttributeSpec &&) noexcept;
    ~AttributeSpec();
    const vespalib::string &getName() const { return _name; }
    const Config &getConfig() const { return *_cfg; }
    bool operator==(const AttributeSpec &rhs) const;
};

} // namespace proton