00001
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef XAPIAN_INCLUDED_NET_POSTLIST_H
00024 #define XAPIAN_INCLUDED_NET_POSTLIST_H
00025
00026 #include <string>
00027
00028 #include "leafpostlist.h"
00029 #include "omassert.h"
00030 #include "remote-database.h"
00031
00032 using namespace std;
00033
00036 class NetworkPostList : public LeafPostList {
00037 friend class RemoteDatabase;
00038
00039 Xapian::Internal::RefCntPtr<const RemoteDatabase> db;
00040 string term;
00041
00042 string postings;
00043 bool started;
00044 const char * pos;
00045 const char * pos_end;
00046
00047 Xapian::docid lastdocid;
00048 Xapian::termcount lastwdf;
00049 Xapian::doclength lastdoclen;
00050 Xapian::Internal::RefCntPtr<PositionList> lastposlist;
00051
00052 Xapian::doccount termfreq;
00053
00055 void append_posting(const string & serialised) {
00056 Assert(pos == NULL);
00057 Assert(!started);
00058 postings.append(serialised);
00059 }
00060
00061 public:
00063 NetworkPostList(Xapian::Internal::RefCntPtr<const RemoteDatabase> db_,
00064 const string & term_)
00065 : db(db_), term(term_), started(false), pos(NULL), pos_end(NULL),
00066 lastdocid(0), lastwdf(0), lastdoclen(0), termfreq(0)
00067 {
00068 termfreq = db->read_post_list(term, *this);
00069 }
00070
00072 Xapian::doccount get_termfreq() const;
00073
00075 Xapian::docid get_docid() const;
00076
00078 Xapian::doclength get_doclength() const;
00079
00081 Xapian::termcount get_wdf() const;
00082
00085 PositionList * read_position_list();
00086
00089 PositionList * open_position_list() const;
00090
00093 PostList * next(Xapian::weight);
00094
00097 PostList * skip_to(Xapian::docid did, Xapian::weight weight);
00098
00100 bool at_end() const;
00101
00103 string get_description() const;
00104 };
00105
00106 #endif