00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef OM_HGUARD_OMTERMLISTITERATOR_H
00025 #define OM_HGUARD_OMTERMLISTITERATOR_H
00026
00027 #include <iterator>
00028 #include "om/omtypes.h"
00029
00030 class OmDatabase;
00031 class OmPositionListIterator;
00032
00035 class OmTermIterator {
00036 private:
00037
00038 friend class OmDatabase;
00039 friend class OmDocument;
00040
00041 public:
00042 class Internal;
00044 Internal *internal;
00045
00046 friend bool operator==(const OmTermIterator &a,
00047 const OmTermIterator &b);
00048
00049 public:
00050
00051 OmTermIterator(Internal *internal_);
00052
00054 OmTermIterator();
00055
00057 ~OmTermIterator();
00058
00062 OmTermIterator(const OmTermIterator &other);
00063
00067 void operator=(const OmTermIterator &other);
00068
00069 om_termname operator *() const;
00070
00071 OmTermIterator & operator++();
00072
00073 void operator++(int);
00074
00075
00076 void skip_to(const om_termname & tname);
00077
00078 om_termcount get_wdf() const;
00079 om_doccount get_termfreq() const;
00080
00081
00082 OmPositionListIterator positionlist_begin();
00083 OmPositionListIterator positionlist_end();
00084
00088 std::string get_description() const;
00089
00091
00092 typedef std::input_iterator_tag iterator_category;
00093 typedef om_termname value_type;
00094 typedef om_termcount_diff difference_type;
00095 typedef om_termname * pointer;
00096 typedef om_termname & reference;
00098 };
00099
00100 inline bool
00101 operator!=(const OmTermIterator &a, const OmTermIterator &b)
00102 {
00103 return !(a == b);
00104 }
00105
00106 #endif