blob: 866153eca78f9d5cb7f8deb8b108db008d6383f3 (
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
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vespa/searchlib/query/base.h>
#include <vector>
#include <memory>
namespace vespalib { class nbostream; }
namespace proton {
class LidVectorContext
{
public:
using LidVector = std::vector<search::DocumentIdT>;
private:
LidVector _result;
size_t _docIdLimit;
enum { ARRAY = 0, BITVECTOR = 1 };
public:
using SP = std::shared_ptr<LidVectorContext>;
LidVectorContext();
LidVectorContext(size_t docIdLimit);
LidVectorContext(size_t docIdLimit, const LidVector &lids);
void addLid(const search::DocumentIdT lid);
void serialize(vespalib::nbostream &os) const;
void deserialize(vespalib::nbostream &is);
const LidVector &getLidVector() const { return _result; }
void clearLidVector() { _result.clear(); }
size_t getDocIdLimit() const { return _docIdLimit; }
size_t getNumLids() const { return _result.size(); }
};
}
|