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


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ScorerDocQueue.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 SCORERDOCQUEUE_H
8 #define SCORERDOCQUEUE_H
9 
10 #include "LuceneObject.h"
11 
12 namespace Lucene
13 {
16  class LPPAPI ScorerDocQueue : public LuceneObject
17  {
18  public:
19  ScorerDocQueue(int32_t maxSize);
20  virtual ~ScorerDocQueue();
21 
23 
24  protected:
26  int32_t maxSize;
27  int32_t _size;
28  HeapedScorerDocPtr topHSD; // same as heap[1], only for speed
29 
30  public:
33  void put(ScorerPtr scorer);
34 
38  bool insert(ScorerPtr scorer);
39 
42  ScorerPtr top();
43 
46  int32_t topDoc();
47 
48  double topScore();
49  bool topNextAndAdjustElsePop();
50  bool topSkipToAndAdjustElsePop(int32_t target);
51 
54  ScorerPtr pop();
55 
57  void adjustTop();
58 
60  int32_t size();
61 
63  void clear();
64 
65  protected:
66  bool checkAdjustElsePop(bool cond);
67 
70  void popNoResult();
71 
72  void upHeap();
73  void downHeap();
74  };
75 }
76 
77 #endif

clucene.sourceforge.net