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

           Branch data     Line data    Source code
       1                 :            : /** @file chert_modifiedpostlist.h
       2                 :            :  * @brief A ChertPostList plus pending modifications
       3                 :            :  */
       4                 :            : /* Copyright (C) 2006,2007,2008,2009 Olly Betts
       5                 :            :  *
       6                 :            :  * This program is free software; you can redistribute it and/or modify
       7                 :            :  * it under the terms of the GNU General Public License as published by
       8                 :            :  * the Free Software Foundation; either version 2 of the License, or
       9                 :            :  * (at your option) any later version.
      10                 :            :  *
      11                 :            :  * This program is distributed in the hope that it will be useful,
      12                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      13                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      14                 :            :  * GNU General Public License for more details.
      15                 :            :  *
      16                 :            :  * You should have received a copy of the GNU General Public License
      17                 :            :  * along with this program; if not, write to the Free Software
      18                 :            :  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
      19                 :            :  */
      20                 :            : 
      21                 :            : #ifndef XAPIAN_INCLUDED_CHERT_MODIFIEDPOSTLIST_H
      22                 :            : #define XAPIAN_INCLUDED_CHERT_MODIFIEDPOSTLIST_H
      23                 :            : 
      24                 :            : #include <map>
      25                 :            : #include <string>
      26                 :            : 
      27                 :            : using namespace std;
      28                 :            : 
      29                 :            : #include "chert_database.h"
      30                 :            : #include "chert_postlist.h"
      31                 :            : 
      32                 :            : class ChertModifiedPostList : public ChertPostList {
      33                 :            :     /// Modifications to apply to the ChertPostList.
      34                 :            :     //@{
      35                 :            :     map<Xapian::docid, pair<char, Xapian::termcount> > mods;
      36                 :            :     map<Xapian::docid, pair<char, Xapian::termcount> >::const_iterator it;
      37                 :            :     //@}
      38                 :            : 
      39                 :            :     /// Pointer to PositionList returned from read_position_list to be deleted.
      40                 :            :     PositionList * poslist;
      41                 :            : 
      42                 :            :     /// Skip over deleted documents after a next() or skip_to().
      43                 :            :     void skip_deletes(Xapian::weight w_min);
      44                 :            : 
      45                 :            :   public:
      46                 :            :     /// Constructor.
      47                 :         96 :     ChertModifiedPostList(Xapian::Internal::RefCntPtr<const ChertDatabase> this_db_,
      48                 :            :                           const string & term_,
      49                 :            :                           const map<Xapian::docid, pair<char, Xapian::termcount> > & mods_)
      50                 :            :         : ChertPostList(this_db_, term_, true),
      51                 :         96 :           mods(mods_), it(mods.begin()), poslist(0)
      52                 :         96 :     { }
      53                 :            : 
      54                 :            :     ~ChertModifiedPostList();
      55                 :            : 
      56                 :            :     Xapian::doccount get_termfreq() const;
      57                 :            : 
      58                 :            :     Xapian::docid get_docid() const;
      59                 :            : 
      60                 :            :     Xapian::termcount get_doclength() const;
      61                 :            : 
      62                 :            :     Xapian::termcount get_wdf() const;
      63                 :            : 
      64                 :            :     PositionList *read_position_list();
      65                 :            : 
      66                 :            :     PositionList *open_position_list() const;
      67                 :            : 
      68                 :            :     PostList * next(Xapian::weight w_min);
      69                 :            : 
      70                 :            :     PostList * skip_to(Xapian::docid desired_did, Xapian::weight w_min);
      71                 :            : 
      72                 :            :     bool at_end() const;
      73                 :            : 
      74                 :            :     std::string get_description() const;
      75                 :            : };
      76                 :            : 
      77                 :            : #endif // XAPIAN_INCLUDED_CHERT_MODIFIEDPOSTLIST_H

Generated by: LCOV version 1.8