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_SegmentTermEnum_ 00008 #define _lucene_index_SegmentTermEnum_ 00009 00010 #if defined(_LUCENE_PRAGMA_ONCE) 00011 # pragma once 00012 #endif 00013 00014 #include "Terms.h" 00015 #include "FieldInfos.h" 00016 #include "TermInfo.h" 00017 00018 CL_NS_DEF(index) 00019 00020 00023 class SegmentTermEnum:public TermEnum{ 00024 private: 00025 Term* _term; 00026 TermInfo* termInfo; 00027 00028 bool isIndex; 00029 bool isClone; 00030 00031 00032 TCHAR* buffer; 00033 uint32_t bufferLength; 00034 00035 int32_t format; 00036 int32_t formatM1SkipInterval; 00037 00038 CL_NS(store)::IndexInput* input; 00039 FieldInfos* fieldInfos; 00040 int64_t size; 00041 int64_t position; 00042 int64_t indexPointer; 00043 Term* prev; 00044 int32_t indexInterval; 00045 int32_t skipInterval; 00046 00047 friend class TermInfosReader; 00048 friend class SegmentTermDocs; 00049 protected: 00050 00055 SegmentTermEnum( const SegmentTermEnum& clone); 00056 00057 public: 00059 SegmentTermEnum(CL_NS(store)::IndexInput* i, FieldInfos* fis, const bool isi ); 00060 00062 ~SegmentTermEnum(); 00063 00067 bool next(); 00068 00072 Term* term(); 00076 Term* term(bool pointer); 00077 00081 void scanTo(const Term *term); 00082 00086 void close(); 00087 00091 int32_t docFreq() const; 00092 00096 void seek(const int64_t pointer, const int32_t p, Term* t, TermInfo* ti); 00097 00101 TermInfo* getTermInfo()const; 00102 00106 void getTermInfo(TermInfo* ti)const; 00107 00111 int64_t freqPointer() const; 00112 00116 int64_t proxPointer() const; 00117 00121 SegmentTermEnum* clone() const; 00122 00123 const char* getObjectName(){ return SegmentTermEnum::getClassName(); } 00124 static const char* getClassName(){ return "SegmentTermEnum"; } 00125 00126 private: 00130 Term* readTerm(Term* reuse); 00134 void growBuffer(const uint32_t length, bool force_copy); 00135 00136 }; 00137 CL_NS_END 00138 #endif