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


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 
12 namespace Lucene {
13 
22 class LPPAPI SortedVIntList : public DocIdSet {
23 public:
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 
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

clucene.sourceforge.net