common/postlist.h

Go to the documentation of this file.
00001 
00004 /* Copyright (C) 2007,2008 Olly Betts
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License as
00008  * published by the Free Software Foundation; either version 2 of the
00009  * License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00019  */
00020 
00021 #ifndef XAPIAN_INCLUDED_POSTLIST_H
00022 #define XAPIAN_INCLUDED_POSTLIST_H
00023 
00024 #include <string>
00025 
00026 #include <xapian/base.h>
00027 #include <xapian/types.h>
00028 #include <xapian/postingiterator.h>
00029 
00030 #include "positionlist.h"
00031 
00033 class Xapian::PostingIterator::Internal : public Xapian::Internal::RefCntBase {
00035     void operator=(const Internal &);
00036 
00038     Internal(const Internal &);
00039 
00040   protected:
00042     Internal() { }
00043 
00044   public:
00048     virtual ~Internal();
00049 
00051     virtual Xapian::doccount get_termfreq_min() const = 0;
00052 
00054     virtual Xapian::doccount get_termfreq_max() const = 0;
00055 
00061     virtual Xapian::doccount get_termfreq_est() const = 0;
00062 
00064     virtual Xapian::weight get_maxweight() const = 0;
00065 
00067     virtual Xapian::docid get_docid() const = 0;
00068 
00070     virtual Xapian::doclength get_doclength() const = 0;
00071 
00076     virtual Xapian::termcount get_wdf() const;
00077 
00079     virtual Xapian::weight get_weight() const = 0;
00080 
00087     virtual const std::string * get_collapse_key() const;
00088 
00090     virtual bool at_end() const = 0;
00091 
00097     virtual Xapian::weight recalc_maxweight() = 0;
00098 
00104     virtual PositionList * read_position_list();
00105 
00111     virtual PositionList * open_position_list() const;
00112 
00127     virtual Internal * next(Xapian::weight w_min) = 0;
00128 
00142     virtual Internal * skip_to(Xapian::docid, Xapian::weight w_min) = 0;
00143 
00163     virtual Internal * check(Xapian::docid did, Xapian::weight w_min,
00164                              bool &valid);
00165 
00170     Internal * next() { return next(0.0); }
00171 
00176     Internal * skip_to(Xapian::docid did) { return skip_to(did, 0.0); }
00177 
00179     virtual std::string get_description() const = 0;
00180 };
00181 
00182 // In the external API headers, this class is Xapian::PostingIterator::Internal,
00183 // but in the library code it's still known as "PostList" in most places.
00184 typedef Xapian::PostingIterator::Internal PostList;
00185 
00186 #endif // XAPIAN_INCLUDED_POSTLIST_H

Documentation for Xapian (version 1.0.10).
Generated on 24 Dec 2008 by Doxygen 1.5.2.