aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/attribute/attribute_collection_spec.cpp
blob: 9f23e8bb50b7f908b7223db3d33ac350f39f5215 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "attribute_collection_spec.h"

namespace proton {

AttributeCollectionSpec::AttributeCollectionSpec(AttributeList && attributes, uint32_t docIdLimit, std::optional<SerialNum> currentSerialNum)
    : _attributes(std::move(attributes)),
      _docIdLimit(docIdLimit),
      _currentSerialNum(currentSerialNum)
{
}

AttributeCollectionSpec::~AttributeCollectionSpec() = default;

bool
AttributeCollectionSpec::hasAttribute(const vespalib::string &name) const {
    for (const auto &attr : _attributes) {
        if (attr.getName() == name) {
            return true;
        }
    }
    return false;
}

}