Logo Search packages:      
Sourcecode: qt4-x11 version File versions


* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
* Distributable under the terms of either the Apache License (Version 2.0) or 
* the GNU Lesser General Public License, as specified in the COPYING file.
#ifndef _lucene_search_HitQueue_
#define _lucene_search_HitQueue_

#if defined(_LUCENE_PRAGMA_ONCE)
# pragma once

#include "SearchHeader.h"


* An optimised PriorityQueue which takes ScoreDoc structs. Some by-ref passing
* and memory related optimisations have been done.
00022 class HitQueue: LUCENE_BASE {
      ScoreDoc* heap;
      size_t _size;
      size_t maxSize;

      void upHeap();
      void downHeap();

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

      void adjustTop();
      struct ScoreDoc& top();
      void put(struct ScoreDoc& element);
      ScoreDoc pop();
      * Adds element to the PriorityQueue in log(size) time if either
      * the PriorityQueue is not full, or not lessThan(element, top()).
      * @param element
      * @return true if element is added, false otherwise.
      bool insert(struct ScoreDoc& element);
      * Returns the number of elements currently stored in the PriorityQueue.
      size_t size();
      HitQueue(const int32_t maxSize);


Generated by  Doxygen 1.6.0   Back to index