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

/include/om/ompositionlistiterator.h

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

Documentation for Xapian (version 0.4.1cvs).
Generated on 20 Sep 2002 by Doxygen 1.2.15.