aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/fef/feature_type.cpp
blob: 825295f7a83b52096419e2676c08e0bd58c4cfc0 (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.

#include "feature_type.h"
#include <cassert>

namespace search::fef {

const FeatureType FeatureType::_number = FeatureType(TYPE_UP());

FeatureType::FeatureType(const FeatureType &rhs)
    : _type()
{
    if (rhs.is_object()) {
        _type = std::make_unique<TYPE>(rhs.type());
    }
}

FeatureType
FeatureType::object(const TYPE &type_in)
{
    return FeatureType(std::make_unique<TYPE>(type_in));
}

const FeatureType::TYPE &
FeatureType::type() const {
    assert(_type);
    return *_type;
}

}