00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef _PROXINFO_HPP_
00016 #define _PROXINFO_HPP_
00017
00018 #include "InvFPIndex.hpp"
00022 class ProxInfo {
00023 public:
00025 ProxInfo() : nextPos(0), posList(NULL), size(0),
00026 dList(NULL), listSize(0) { }
00028 ProxInfo::ProxInfo(int num, int tf, DocInfoList *dl) : nextPos(0),
00029 posList(NULL),
00030 size(0),
00031 dList(dl),
00032 listSize(tf) { }
00034 ProxInfo(int num, int tf, int *pl);
00036 ~ProxInfo() { delete(dList); delete[](posList);}
00037
00039 int id() {return currEntry.docID();}
00041 int count() {return currEntry.termCount();}
00043 int *positions() {return currEntry.positions();}
00046 int position(int k) {return *(positions() + k);}
00048 void startIteration() {
00049 if (dList != NULL) dList->startIteration();
00050 }
00052 bool hasMore() {return(dList != NULL && dList->hasMore());}
00054 bool nextDoc();
00057 bool nextDoc(int did);
00059 int posSize();
00061 int size;
00064 int nextPos;
00065 private:
00067 int *posList;
00069
00070 InvFPDocInfo currEntry;
00071 int listSize;
00072 };
00073 #endif