Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

include/xapian/postlistiterator.h

Go to the documentation of this file.
00001 
00024 #ifndef XAPIAN_INCLUDED_POSTLISTITERATOR_H
00025 #define XAPIAN_INCLUDED_POSTLISTITERATOR_H
00026 
00027 #include <iterator>
00028 #include <xapian/types.h>
00029 
00030 namespace Xapian {
00031 
00032 class Database;
00033 class PositionListIterator;
00034 
00035 class PostListIterator {
00036 private:
00037     friend class Database; // So Database can construct us
00038 
00039     PostListIterator(Internal *internal_);
00040 
00041 public:
00042     class Internal;
00044     Internal *internal;
00045 
00046     friend bool operator==(const PostListIterator &a,
00047                            const PostListIterator &b);
00048 
00050     PostListIterator();
00051 
00053     ~PostListIterator();
00054 
00058     PostListIterator(const PostListIterator &other);
00059 
00063     void operator=(const PostListIterator &other);
00064 
00065     PostListIterator & operator++();
00066 
00067     void operator++(int);
00068 
00069     // extra method, not required for an input_iterator
00070     void skip_to(docid did);
00071 
00072     // Get the weight of the posting at the current position: will
00073     // need to set a weight object for this to work.
00074     // weight get_weight() const;
00075 
00077     docid operator *() const;
00078 
00088     doclength get_doclength() const;
00089 
00093     termcount get_wdf() const;
00094 
00095     // allow iteration of positionlist for current term
00096     PositionListIterator positionlist_begin();
00097     PositionListIterator positionlist_end();
00098 
00099     // Don't expose these methods here.  A container iterator doesn't
00100     // provide a method to find the size of the container...
00101     // doccount get_termfreq() const;
00102     // termcount get_collection_freq() const;
00103 
00107     std::string get_description() const;
00108 
00110 
00111     typedef std::input_iterator_tag iterator_category;
00112     typedef docid value_type;
00113     typedef doccount_diff difference_type;
00114     typedef docid * pointer;
00115     typedef docid & reference;
00117 };
00118 
00119 inline bool operator!=(const PostListIterator &a, const PostListIterator &b)
00120 {
00121     return !(a == b);
00122 }
00123 
00124 };
00125 
00126 #endif

Documentation for Xapian (version 0.6.3).
Generated on 24 Dec 2002 by Doxygen 1.2.15.