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
00041 string postings;
00042 bool started;
00043 const char * pos;
00044 const char * pos_end;
00045
00046 Xapian::docid lastdocid;
00047 Xapian::termcount lastwdf;
00048 Xapian::Internal::RefCntPtr<PositionList> lastposlist;
00049
00050 Xapian::doccount termfreq;
00051
00053 void append_posting(const string & serialised) {
00054 Assert(pos == NULL);
00055 Assert(!started);
00056 postings.append(serialised);
00057 }
00058
00059 public:
00061 NetworkPostList(Xapian::Internal::RefCntPtr<const RemoteDatabase> db_,
00062 const string & term_)
00063 : LeafPostList(term_),
00064 db(db_), started(false), pos(NULL), pos_end(NULL),
00065 lastdocid(0), lastwdf(0), termfreq(0)
00066 {
00067 termfreq = db->read_post_list(term, *this);
00068 }
00069
00071 Xapian::doccount get_termfreq() const;
00072
00074 Xapian::docid get_docid() const;
00075
00077 Xapian::termcount get_doclength() const;
00078
00080 Xapian::termcount get_wdf() const;
00081
00084 PositionList * read_position_list();
00085
00088 PositionList * open_position_list() const;
00089
00092 PostList * next(Xapian::weight);
00093
00096 PostList * skip_to(Xapian::docid did, Xapian::weight weight);
00097
00099 bool at_end() const;
00100
00102 string get_description() const;
00103 };
00104
00105 #endif