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


lucene::search::HitQueue Class Reference

An optimised PriorityQueue which takes ScoreDoc structs. More...

#include <HitQueue.h>

Inheritance diagram for lucene::search::HitQueue:
lucene::debug::LuceneBase

List of all members.

Public Member Functions

void adjustTop ()
struct ScoreDoctop ()
void put (struct ScoreDoc &element)
ScoreDoc pop ()
bool insert (struct ScoreDoc &element)
 Adds element to the PriorityQueue in log(size) time if either the PriorityQueue is not full, or not lessThan(element, top()).
size_t size ()
 Returns the number of elements currently stored in the PriorityQueue.
 HitQueue (const int32_t maxSize)
 ~HitQueue ()

Protected Member Functions

bool lessThan (struct ScoreDoc &hitA, struct ScoreDoc &hitB)

Detailed Description

An optimised PriorityQueue which takes ScoreDoc structs.

Some by-ref passing and memory related optimisations have been done.


Constructor & Destructor Documentation

lucene::search::HitQueue::HitQueue ( const int32_t  maxSize  ) 
lucene::search::HitQueue::~HitQueue (  ) 

Member Function Documentation

void lucene::search::HitQueue::adjustTop (  ) 
bool lucene::search::HitQueue::insert ( struct ScoreDoc element  ) 

Adds element to the PriorityQueue in log(size) time if either the PriorityQueue is not full, or not lessThan(element, top()).

Parameters:
element 
Returns:
true if element is added, false otherwise.
bool lucene::search::HitQueue::lessThan ( struct ScoreDoc hitA,
struct ScoreDoc hitB 
) [protected]
ScoreDoc lucene::search::HitQueue::pop (  ) 
void lucene::search::HitQueue::put ( struct ScoreDoc element  ) 
size_t lucene::search::HitQueue::size (  ) 

Returns the number of elements currently stored in the PriorityQueue.

struct ScoreDoc& lucene::search::HitQueue::top (  )  [read]

The documentation for this class was generated from the following file:

clucene.sourceforge.net