Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

DiskDocListFileIterator.hpp

Go to the documentation of this file.
00001 /*==========================================================================
00002  * Copyright (c) 2004 University of Massachusetts.  All Rights Reserved.
00003  *
00004  * Use of the Lemur Toolkit for Language Modeling and Information Retrieval
00005  * is subject to the terms of the software license set forth in the LICENSE
00006  * file included with this software, and also available at
00007  * http://www.lemurproject.org/license.html
00008  *
00009  *==========================================================================
00010  */
00011 
00012 //
00013 // DiskDocListFileIterator
00014 //
00015 // 13 December 2004 -- tds
00016 //
00017 
00018 #ifndef INDRI_DISKDOCLISTFILEITERATOR_HPP
00019 #define INDRI_DISKDOCLISTFILEITERATOR_HPP
00020 
00021 #include "indri/DocListFileIterator.hpp"
00022 #include "indri/DiskDocListIterator.hpp"
00023 #include "indri/Buffer.hpp"
00024 #include "Keyfile.hpp"
00025 #include "indri/SequentialReadBuffer.hpp"
00026 #include "indri/File.hpp"
00027 
00028 namespace indri {
00029   namespace index {
00030     class DiskDocListFileIterator : public DocListFileIterator {
00031     private:
00032       indri::file::SequentialReadBuffer* _file;
00033       UINT64 _fileLength;
00034 
00035       int _fieldCount;
00036       indri::utility::Buffer _header;
00037 
00038       char _term[ lemur::file::Keyfile::MAX_KEY_LENGTH+1 ];
00039       TermData* _termData;
00040       DiskDocListIterator _iterator;
00041       DocListData _docListData;
00042       bool _finished;
00043 
00044       void _readEntry();
00045 
00046     public:
00047       DiskDocListFileIterator( indri::file::File& docListFile, int fieldCount );
00048       ~DiskDocListFileIterator();
00049       
00050       bool finished() const;
00051       void startIteration();
00052 
00053       bool nextEntry();
00054       DocListData* currentEntry();
00055       const DocListData* currentEntry() const;
00056     };
00057   }
00058 }
00059 
00060 #endif // INDRI_DISKDOCLISTFILEITERATOR_HPP
00061 

Generated on Tue Jun 15 11:02:53 2010 for Lemur by doxygen 1.3.4