00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef _INVFPDOCLIST_HPP
00014 #define _INVFPDOCLIST_HPP
00015
00016
00017
00018
00019
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 namespace lemur
00034 {
00035 namespace index
00036 {
00037
00038 class InvFPDocList: public InvDocList {
00039 public:
00040 InvFPDocList();
00042 InvFPDocList(lemur::api::LOC_T *vec);
00043
00046 InvFPDocList(lemur::api::TERMID_T id, int len);
00048 InvFPDocList(lemur::utility::MemCache* mc, lemur::api::TERMID_T id, int len);
00049 InvFPDocList(lemur::utility::MemCache* mc, lemur::api::TERMID_T id, int len, lemur::api::DOCID_T docid, lemur::api::LOC_T location);
00051 InvFPDocList(lemur::api::TERMID_T id, int listlen, lemur::api::LOC_T* list, int fr, lemur::api::DOCID_T* ldocid, int len);
00052 ~InvFPDocList();
00053
00054 bool addTerm(lemur::api::DOCID_T docid);
00055 bool addLocation(lemur::api::DOCID_T docid, lemur::api::LOC_T location);
00056 bool append(InvDocList* tail);
00057
00058 virtual lemur::api::DocInfo* nextEntry() const;
00059 virtual void nextEntry(lemur::api::DocInfo* info) const;
00060 virtual void nextEntry(InvFPDocInfo* info) const;
00061 virtual lemur::api::COUNT_T termCTF() const;
00062 lemur::api::LOC_T *byteVec(lemur::api::COUNT_T &len);
00063
00064 protected:
00065
00067 virtual lemur::api::DocInfo* newElement() const { return new InvFPDocInfo(); }
00069 virtual lemur::api::DocInfo* getElement(lemur::api::DocInfo* elem, lemur::api::POS_T position) const;
00071 virtual void assignElement(lemur::api::DocInfo* to, lemur::api::DocInfo* from) const {
00072 *static_cast<InvFPDocInfo*>(to) = *static_cast<InvFPDocInfo*>(from);
00073 }
00075 virtual lemur::api::POS_T nextPosition(lemur::api::POS_T position) const;
00076
00079 virtual void deltaEncode();
00080
00083 virtual void deltaDecode();
00084
00085 private:
00086 mutable InvFPDocInfo entry;
00087 };
00088 }
00089 }
00090
00091 #endif