aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/attribute/attribute_factory.cpp
blob: e5a12fe2c9e9a280aea46cf7df748a351721a4f3 (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 Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "attribute_factory.h"
#include <vespa/searchlib/attribute/attributefactory.h>
#include <vespa/searchlib/attribute/attributevector.h>


namespace proton {

using search::AttributeVector;

AttributeFactory::AttributeFactory() = default;

AttributeVector::SP
AttributeFactory::create(const vespalib::string &name, const search::attribute::Config &cfg) const
{
    AttributeVector::SP v(search::AttributeFactory::createAttribute(name, cfg));
    return v;
}

void
AttributeFactory::setupEmpty(const AttributeVector::SP &vec, std::optional<search::SerialNum> serialNum) const
{
    if (serialNum.has_value()) {
        vec->setCreateSerialNum(serialNum.value());
    }
    vec->addReservedDoc();
}

}