Lucene++ - a full-featured, c++ search engine
API Documentation

SortedVIntList.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2014 Alan Wright. All rights reserved.
3 // Distributable under the terms of either the Apache License (Version 2.0)
4 // or the GNU Lesser General Public License.
6
7 #ifndef SORTEDVINTLIST_H
8 #define SORTEDVINTLIST_H
9
10 #include "DocIdSet.h"
11
12 namespace Lucene {
13
22 class LPPAPI SortedVIntList : public DocIdSet {
23 public:
26 SortedVIntList(Collection<int32_t> sortedInts);
27
31 SortedVIntList(Collection<int32_t> sortedInts, int32_t inputSize);
32
35 SortedVIntList(const BitSetPtr& bits);
36
39 SortedVIntList(const OpenBitSetPtr& bits);
40
45 SortedVIntList(const DocIdSetIteratorPtr& docIdSetIterator);
46
47 virtual ~SortedVIntList();
48
49 LUCENE_CLASS(SortedVIntList);
50
51 public:
54 static const int32_t BITS2VINTLIST_SIZE;
55
56 protected:
57 static const int32_t VB1;
58 static const int32_t BIT_SHIFT;
59 static const int32_t MAX_BYTES_PER_INT;
60
61 int32_t _size;
62 ByteArray bytes;
63 int32_t lastBytePos;
64 int32_t lastInt;
65
66 public:
68 int32_t size();
69
71 int32_t getByteSize();
72
74 virtual bool isCacheable();
75
77 virtual DocIdSetIteratorPtr iterator();
78
79 protected:
80 void initBytes();
81 void addInt(int32_t nextInt);
82
83 friend class SortedDocIdSetIterator;
84 };
85
86 }
87
88 #endif
Lucene::SortedVIntList::lastBytePos
int32_t lastBytePos
Definition: SortedVIntList.h:63
Lucene::SortedVIntList::lastInt
int32_t lastInt
Definition: SortedVIntList.h:64
Lucene::OpenBitSetPtr
boost::shared_ptr< OpenBitSet > OpenBitSetPtr
Definition: LuceneTypes.h:543
Lucene::SortedVIntList::BIT_SHIFT
static const int32_t BIT_SHIFT
Definition: SortedVIntList.h:58
DocIdSet.h
Lucene::SortedVIntList
Stores and iterate on sorted integers in compressed form in RAM.
Definition: SortedVIntList.h:22
Lucene::SortedVIntList::MAX_BYTES_PER_INT
static const int32_t MAX_BYTES_PER_INT
Definition: SortedVIntList.h:59
Lucene::DocIdSetIteratorPtr
boost::shared_ptr< DocIdSetIterator > DocIdSetIteratorPtr
Definition: LuceneTypes.h:324
Lucene::SortedVIntList::bytes
ByteArray bytes
Definition: SortedVIntList.h:62
Lucene::SortedVIntList::_size
int32_t _size
Definition: SortedVIntList.h:61
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::SortedVIntList::VB1
static const int32_t VB1
Definition: SortedVIntList.h:57
Lucene::Collection< int32_t >
Lucene::DocIdSet
A DocIdSet contains a set of doc ids. Implementing classes must only implement iterator to provide ac...
Definition: DocIdSet.h:16
Lucene::BitSetPtr
boost::shared_ptr< BitSet > BitSetPtr
Definition: LuceneTypes.h:522

clucene.sourceforge.net