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

include/om/ompositionlistiterator.h

Go to the documentation of this file.
00001 
00004 /* ----START-LICENCE----
00005  * Copyright 1999,2000,2001 BrightStation PLC
00006  * Copyright 2002 Ananova Ltd
00007  *
00008  * This program is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU General Public License as
00010  * published by the Free Software Foundation; either version 2 of the
00011  * License, or (at your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00021  * USA
00022  * -----END-LICENCE-----
00023  */
00024 
00025 #ifndef OM_HGUARD_OMPOSITIONLISTITERATOR_H
00026 #define OM_HGUARD_OMPOSITIONLISTITERATOR_H
00027 
00028 #include <iterator>
00029 #include "om/omtypes.h"
00030 
00031 class OmPostListIterator;
00032 class OmTermIterator;
00033 class OmDatabase;
00034 
00035 class OmPositionListIterator {
00036     private:
00037         // friend classes which need to be able to construct us
00038         friend class OmPostListIterator;
00039         friend class OmTermIterator;
00040         friend class OmDatabase;
00041 
00042     public:
00043         class Internal;
00045         Internal *internal;
00046 
00047         friend bool operator==(const OmPositionListIterator &a, const OmPositionListIterator &b);
00048 
00049         // FIXME: ought to be private
00050         OmPositionListIterator(Internal *internal_);
00051 
00053         OmPositionListIterator();
00054 
00056         ~OmPositionListIterator();
00057 
00058         void operator=(OmPositionListIterator &o);
00059         OmPositionListIterator (const OmPositionListIterator &o);
00060 
00061         om_termpos operator *() const;
00062 
00063         OmPositionListIterator & operator++();
00064 
00065         void operator++(int);
00066 
00067         // extra method, not required for an input_iterator
00068         void skip_to(om_termpos pos);
00069 
00073         std::string get_description() const;
00074 
00075         // Allow use as an STL iterator
00076         typedef std::input_iterator_tag iterator_category;
00077         typedef om_termpos value_type;
00078         typedef om_termpos_diff difference_type;  // "om_termposcount"
00079         typedef om_termpos * pointer;
00080         typedef om_termpos & reference;
00081 };
00082 
00083 inline bool operator!=(const OmPositionListIterator &a,
00084                        const OmPositionListIterator &b)
00085 {
00086     return !(a == b);
00087 }
00088 
00089 #endif /* OM_HGUARD_OMPOSITIONLISTITERATOR_H */

Documentation for Xapian (version 0.6.4).
Generated on 10 Apr 2003 by Doxygen 1.2.15.