aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/attribute/postinglisttraits.h
blob: 928ecc7aaf1bdacd75d29cc3722af70cf748d826 (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
34
35
36
37
38
39
40
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/vespalib/btree/btreestore.h>

namespace search::attribute {

template <typename DataT> class PostingListTraits;
template <typename DataT> class PostingStore;

template <>
class PostingListTraits<vespalib::btree::BTreeNoLeafData>
{
private:
    using BTreeTraits = vespalib::btree::BTreeTraits<64, 16, 8, true>;
public:
    using AggregatedType = vespalib::btree::NoAggregated;
    using AggrCalcType = vespalib::btree::NoAggrCalc;
    using const_iterator = vespalib::btree::BTreeConstIterator<uint32_t, vespalib::btree::BTreeNoLeafData, AggregatedType, std::less<uint32_t>, BTreeTraits >;
    using PostingStoreBase = vespalib::btree::BTreeStore<uint32_t, vespalib::btree::BTreeNoLeafData, AggregatedType, std::less<uint32_t>, BTreeTraits, AggrCalcType> ;
    using PostingList = PostingStore<vespalib::btree::BTreeNoLeafData>;
    using Posting = PostingStoreBase::KeyDataType;
};

template <>
class PostingListTraits<int32_t>
{
private:
    using BTreeTraits = vespalib::btree::BTreeTraits<32, 16, 9, true>;
public:
    using AggregatedType = vespalib::btree::MinMaxAggregated;
    using AggrCalcType = vespalib::btree::MinMaxAggrCalc;
    using const_iterator = vespalib::btree::BTreeConstIterator<uint32_t, int32_t, AggregatedType, std::less<uint32_t>, BTreeTraits >;
    using PostingStoreBase = vespalib::btree::BTreeStore<uint32_t, int32_t, AggregatedType, std::less<uint32_t>, BTreeTraits, AggrCalcType>;
    using PostingList = PostingStore<int32_t>;
    using Posting = PostingStoreBase::KeyDataType;
};

}