Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

InvFPDocList.hpp

Go to the documentation of this file.
00001 /*==========================================================================
00002  * Copyright (c) 2001 Carnegie Mellon University.  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 #ifndef _INVFPDOCLIST_HPP
00014 #define _INVFPDOCLIST_HPP
00015 
00016 /*
00017  * NAME DATE - COMMENTS
00018  * tnt 03/2001 - created
00019  * tnt 06/2002 - subclass from InvDocList
00020  *
00021  *========================================================================*/
00022 #include <cmath>
00023 #include "common_headers.hpp"
00024 #include "InvDocList.hpp"
00025 #include "InvFPDocInfo.hpp"
00026 #include "MemCache.hpp"
00027 
00028 extern "C" {
00029   #include <cstdio>
00030 }
00031 
00032 #define DEFAULT 9
00033 
00034 class InvFPDocList: public InvDocList {
00035 public:
00036   InvFPDocList();
00038   InvFPDocList(LOC_T *vec);
00039 
00042   InvFPDocList(TERMID_T id, int len);
00044   InvFPDocList(MemCache* mc, TERMID_T id, int len);
00045   InvFPDocList(MemCache* mc, TERMID_T id, int len, DOCID_T docid, LOC_T location);
00047   InvFPDocList(TERMID_T id, int listlen, LOC_T* list, int fr, DOCID_T* ldocid, int len);
00048   ~InvFPDocList();
00049 
00050   bool addTerm(DOCID_T docid);
00051   bool addLocation(DOCID_T docid, LOC_T location);
00052   bool append(InvDocList* tail);
00053 
00054   virtual DocInfo* nextEntry() const;
00055   virtual void nextEntry(InvFPDocInfo* info) const;
00056   virtual COUNT_T termCTF() const;
00057   LOC_T *byteVec(COUNT_T &len);
00058 
00059 protected:
00060   // Helper functions for iterator, subclasses should override
00062   virtual DocInfo* newElement() const { return new InvFPDocInfo(); }
00064   virtual DocInfo* getElement(DocInfo* elem, POS_T position) const;
00066   virtual void assignElement(DocInfo* to, DocInfo* from) const { 
00067     *static_cast<InvFPDocInfo*>(to) = *static_cast<InvFPDocInfo*>(from); 
00068   }
00070   virtual POS_T nextPosition(POS_T position) const;
00071 
00074   virtual void deltaEncode();
00075 
00078   virtual void deltaDecode();
00079 
00080 private:
00081   mutable InvFPDocInfo entry;
00082 };
00083 
00084 #endif

Generated on Wed Nov 3 12:58:58 2004 for Lemur Toolkit by doxygen1.2.18