LCOV - code coverage report
Current view: top level - matcher - valuerangepostlist.h (source / functions) Hit Total Coverage
Test: Test Coverage for xapian-core r Lines: 2 2 100.0 %
Date: 2011-08-21 Functions: 2 2 100.0 %
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /** @file valuerangepostlist.h
       2                 :            :  * @brief Return document ids matching a range test on a specified doc value.
       3                 :            :  */
       4                 :            : /* Copyright 2007,2008,2009 Olly Betts
       5                 :            :  * Copyright 2009 Lemur Consulting Ltd
       6                 :            :  * Copyright 2010 Richard Boulton
       7                 :            :  *
       8                 :            :  * This program is free software; you can redistribute it and/or modify
       9                 :            :  * it under the terms of the GNU General Public License as published by
      10                 :            :  * the Free Software Foundation; either version 2 of the License, or
      11                 :            :  * (at your option) any later version.
      12                 :            :  *
      13                 :            :  * This program is distributed in the hope that it will be useful,
      14                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      15                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      16                 :            :  * GNU General Public License for more details.
      17                 :            :  *
      18                 :            :  * You should have received a copy of the GNU General Public License
      19                 :            :  * along with this program; if not, write to the Free Software
      20                 :            :  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
      21                 :            :  */
      22                 :            : 
      23                 :            : #ifndef XAPIAN_INCLUDED_VALUERANGEPOSTLIST_H
      24                 :            : #define XAPIAN_INCLUDED_VALUERANGEPOSTLIST_H
      25                 :            : 
      26                 :            : #include "database.h"
      27                 :            : #include "postlist.h"
      28                 :            : #include "valuelist.h"
      29                 :            : 
      30                 :            : class ValueRangePostList : public PostList {
      31                 :            :   protected:
      32                 :            :     const Xapian::Database::Internal *db;
      33                 :            : 
      34                 :            :     Xapian::valueno valno;
      35                 :            : 
      36                 :            :     const std::string begin, end;
      37                 :            : 
      38                 :            :     Xapian::doccount db_size;
      39                 :            : 
      40                 :            :     ValueList * valuelist;
      41                 :            : 
      42                 :            :     /// Disallow copying.
      43                 :            :     ValueRangePostList(const ValueRangePostList &);
      44                 :            : 
      45                 :            :     /// Disallow assignment.
      46                 :            :     void operator=(const ValueRangePostList &);
      47                 :            : 
      48                 :            :   public:
      49                 :       6174 :     ValueRangePostList(const Xapian::Database::Internal *db_,
      50                 :            :                        Xapian::valueno valno_,
      51                 :            :                        const std::string &begin_, const std::string &end_)
      52                 :            :         : db(db_), valno(valno_), begin(begin_), end(end_),
      53                 :       6174 :           db_size(db->get_doccount()), valuelist(0) { }
      54                 :            : 
      55                 :            :     ~ValueRangePostList();
      56                 :            : 
      57                 :            :     Xapian::doccount get_termfreq_min() const;
      58                 :            : 
      59                 :            :     Xapian::doccount get_termfreq_est() const;
      60                 :            : 
      61                 :            :     Xapian::doccount get_termfreq_max() const;
      62                 :            : 
      63                 :            :     TermFreqs get_termfreq_est_using_stats(
      64                 :            :         const Xapian::Weight::Internal & stats) const;
      65                 :            : 
      66                 :            :     Xapian::weight get_maxweight() const;
      67                 :            : 
      68                 :            :     Xapian::docid get_docid() const;
      69                 :            : 
      70                 :            :     Xapian::weight get_weight() const;
      71                 :            : 
      72                 :            :     Xapian::termcount get_doclength() const;
      73                 :            : 
      74                 :            :     Xapian::weight recalc_maxweight();
      75                 :            : 
      76                 :            :     PositionList * read_position_list();
      77                 :            : 
      78                 :            :     PositionList * open_position_list() const;
      79                 :            : 
      80                 :            :     PostList * next(Xapian::weight w_min);
      81                 :            : 
      82                 :            :     PostList * skip_to(Xapian::docid, Xapian::weight w_min);
      83                 :            : 
      84                 :            :     PostList * check(Xapian::docid did, Xapian::weight w_min, bool &valid);
      85                 :            : 
      86                 :            :     bool at_end() const;
      87                 :            : 
      88                 :            :     Xapian::termcount count_matching_subqs() const;
      89                 :            : 
      90                 :            :     string get_description() const;
      91                 :            : };
      92                 :            : 
      93                 :            : #endif /* XAPIAN_INCLUDED_VALUERANGEPOSTLIST_H */

Generated by: LCOV version 1.8