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


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
TermsHashPerField.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2011 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 TERMSHASHPERFIELD_H
8 #define TERMSHASHPERFIELD_H
9 
11 
12 namespace Lucene
13 {
15  {
16  public:
18  virtual ~TermsHashPerField();
19 
21 
22  public:
31 
32  // Copied from our perThread
36 
37  int32_t streamCount;
38  int32_t numPostingInt;
39 
41 
43  int32_t numPostings;
44 
45  IntArray intUptos;
46  int32_t intUptoStart;
47 
48  protected:
54  bool doCall;
55  bool doNextCall;
56 
57  public:
58  virtual void initialize();
59  void shrinkHash(int32_t targetSize);
60  void reset();
61 
63  virtual void abort();
64 
65  void initReader(ByteSliceReaderPtr reader, RawPostingListPtr p, int32_t stream);
66 
69 
71  virtual void start(FieldablePtr field);
72 
74  virtual bool start(Collection<FieldablePtr> fields, int32_t count);
75 
76  void add(int32_t textStart);
77 
79  virtual void add();
80 
81  void writeByte(int32_t stream, int8_t b);
82  void writeBytes(int32_t stream, const uint8_t* b, int32_t offset, int32_t length);
83  void writeVInt(int32_t stream, int32_t i);
84 
86  virtual void finish();
87 
89  void rehashPostings(int32_t newSize);
90 
91  protected:
92  void compactPostings();
93 
95  bool postingEquals(const wchar_t* tokenText, int32_t tokenTextLen);
96  };
97 }
98 
99 #endif

clucene.sourceforge.net