CLucene - a full-featured, c++ search engine
API Documentation
00001 /*------------------------------------------------------------------------------ 00002 * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team 00003 * 00004 * Distributable under the terms of either the Apache License (Version 2.0) or 00005 * the GNU Lesser General Public License, as specified in the COPYING file. 00006 ------------------------------------------------------------------------------*/ 00007 #ifndef _lucene_index_SegmentMergeQueue_ 00008 #define _lucene_index_SegmentMergeQueue_ 00009 00010 #if defined(_LUCENE_PRAGMA_ONCE) 00011 # pragma once 00012 #endif 00013 00014 #include "CLucene/util/PriorityQueue.h" 00015 #include "SegmentMergeInfo.h" 00016 00017 CL_NS_DEF(index) 00018 class SegmentMergeQueue :public CL_NS(util)::PriorityQueue<SegmentMergeInfo*,CL_NS(util)::Deletor::Object<SegmentMergeInfo> > { 00019 public: 00020 //Constructor 00021 //Creates a queue of length size 00022 SegmentMergeQueue(const int32_t size); 00023 00024 //Destructor 00025 //Does nothing as its parent class will clean up everything 00026 ~SegmentMergeQueue(); 00027 00028 //Closes and destroyes all SegmentMergeInfo Instances in the queue 00029 void close(); 00030 protected: 00031 //Overloaded method that implements the lessThan operator for the parent class 00032 //This method is used by the parent class Priority queue to reorder its internal 00033 //data structures. This implementation check if stiA is less than the current term of stiB. 00034 bool lessThan(SegmentMergeInfo* stiA, SegmentMergeInfo* stiB); 00035 00036 }; 00037 CL_NS_END 00038 #endif