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


Loading...
Searching...
No Matches
SortedVIntList.h
Go to the documentation of this file.
1
2// 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
12namespace Lucene {
13
22class LPPAPI SortedVIntList : public DocIdSet {
23public:
27
31 SortedVIntList(Collection<int32_t> sortedInts, int32_t inputSize);
32
36
40
45 SortedVIntList(const DocIdSetIteratorPtr& docIdSetIterator);
46
47 virtual ~SortedVIntList();
48
50
51public:
54 static const int32_t BITS2VINTLIST_SIZE;
55
56protected:
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
66public:
68 int32_t size();
69
71 int32_t getByteSize();
72
74 virtual bool isCacheable();
75
78
79protected:
80 void initBytes();
81 void addInt(int32_t nextInt);
82
83 friend class SortedDocIdSetIterator;
84};
85
86}
87
88#endif
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Utility template class to handle collections that can be safely copied and shared.
Definition Collection.h:17
A DocIdSet contains a set of doc ids. Implementing classes must only implement iterator to provide ac...
Definition DocIdSet.h:16
Stores and iterate on sorted integers in compressed form in RAM.
Definition SortedVIntList.h:22
SortedVIntList(const DocIdSetIteratorPtr &docIdSetIterator)
Create a SortedVIntList.
ByteArray bytes
Definition SortedVIntList.h:62
static const int32_t MAX_BYTES_PER_INT
Definition SortedVIntList.h:59
static const int32_t BITS2VINTLIST_SIZE
When a BitSet has fewer than 1 in BITS2VINTLIST_SIZE bits set, a SortedVIntList representing the inde...
Definition SortedVIntList.h:54
static const int32_t VB1
Definition SortedVIntList.h:57
int32_t _size
Definition SortedVIntList.h:61
SortedVIntList(const BitSetPtr &bits)
Create a SortedVIntList from a BitSet.
virtual DocIdSetIteratorPtr iterator()
int32_t lastBytePos
Definition SortedVIntList.h:63
static const int32_t BIT_SHIFT
Definition SortedVIntList.h:58
int32_t lastInt
Definition SortedVIntList.h:64
SortedVIntList(Collection< int32_t > sortedInts, int32_t inputSize)
Create a SortedVIntList from an array of integers.
SortedVIntList(const OpenBitSetPtr &bits)
Create a SortedVIntList from an OpenBitSet.
virtual bool isCacheable()
This DocIdSet implementation is cacheable.
void addInt(int32_t nextInt)
SortedVIntList(Collection< int32_t > sortedInts)
Create a SortedVIntList from all elements of an array of integers.
Definition AbstractAllTermDocs.h:12
boost::shared_ptr< DocIdSetIterator > DocIdSetIteratorPtr
Definition LuceneTypes.h:324
boost::shared_ptr< BitSet > BitSetPtr
Definition LuceneTypes.h:522
boost::shared_ptr< OpenBitSet > OpenBitSetPtr
Definition LuceneTypes.h:543

clucene.sourceforge.net