LCOV - code coverage report
Current view: top level - backends/glass - glass_alldocspostlist.cc (source / functions) Hit Total Coverage
Test: Test Coverage for xapian-core 954b5873a738 Lines: 7 18 38.9 %
Date: 2019-06-30 05:20:33 Functions: 3 6 50.0 %
Branches: 1 30 3.3 %

           Branch data     Line data    Source code
       1                 :            : /** @file glass_alldocspostlist.cc
       2                 :            :  * @brief A PostList which iterates over all documents in a GlassDatabase.
       3                 :            :  */
       4                 :            : /* Copyright (C) 2006,2007,2008,2009 Olly Betts
       5                 :            :  * Copyright (C) 2008 Lemur Consulting Ltd
       6                 :            :  *
       7                 :            :  * This program is free software; you can redistribute it and/or modify
       8                 :            :  * it under the terms of the GNU General Public License as published by
       9                 :            :  * the Free Software Foundation; either version 2 of the License, or
      10                 :            :  * (at your option) any later version.
      11                 :            :  *
      12                 :            :  * This program is distributed in the hope that it will be useful,
      13                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      14                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      15                 :            :  * GNU General Public License for more details.
      16                 :            :  *
      17                 :            :  * You should have received a copy of the GNU General Public License
      18                 :            :  * along with this program; if not, write to the Free Software
      19                 :            :  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
      20                 :            :  */
      21                 :            : 
      22                 :            : #include <config.h>
      23                 :            : #include "glass_alldocspostlist.h"
      24                 :            : 
      25                 :            : #include <string>
      26                 :            : 
      27                 :            : #include "glass_database.h"
      28                 :            : #include "debuglog.h"
      29                 :            : 
      30                 :            : #include "str.h"
      31                 :            : 
      32                 :            : using namespace std;
      33                 :            : using Xapian::Internal::intrusive_ptr;
      34                 :            : 
      35                 :         49 : GlassAllDocsPostList::GlassAllDocsPostList(intrusive_ptr<const GlassDatabase> db_,
      36                 :            :                                            Xapian::doccount doccount_)
      37                 :            :         : GlassPostList(db_, string(), true),
      38         [ +  - ]:         49 :           doccount(doccount_)
      39                 :            : {
      40                 :            :     LOGCALL_CTOR(DB, "GlassAllDocsPostList", db_.get() | doccount_);
      41                 :         49 : }
      42                 :            : 
      43                 :            : Xapian::doccount
      44                 :         12 : GlassAllDocsPostList::get_termfreq() const
      45                 :            : {
      46                 :            :     LOGCALL(DB, Xapian::doccount, "GlassAllDocsPostList::get_termfreq", NO_ARGS);
      47                 :         12 :     RETURN(doccount);
      48                 :            : }
      49                 :            : 
      50                 :            : Xapian::termcount
      51                 :       2148 : GlassAllDocsPostList::get_wdf() const
      52                 :            : {
      53                 :            :     LOGCALL(DB, Xapian::termcount, "GlassAllDocsPostList::get_wdf", NO_ARGS);
      54                 :            :     AssertParanoid(!at_end());
      55                 :       2148 :     RETURN(1);
      56                 :            : }
      57                 :            : 
      58                 :            : PositionList *
      59                 :          0 : GlassAllDocsPostList::read_position_list()
      60                 :            : {
      61                 :            :     LOGCALL(DB, PositionList *, "GlassAllDocsPostList::read_position_list", NO_ARGS);
      62 [ #  # ][ #  # ]:          0 :     throw Xapian::InvalidOperationError("GlassAllDocsPostList::read_position_list() not meaningful");
                 [ #  # ]
      63                 :            : }
      64                 :            : 
      65                 :            : PositionList *
      66                 :          0 : GlassAllDocsPostList::open_position_list() const
      67                 :            : {
      68                 :            :     LOGCALL(DB, PositionList *, "GlassAllDocsPostList::open_position_list", NO_ARGS);
      69 [ #  # ][ #  # ]:          0 :     throw Xapian::InvalidOperationError("GlassAllDocsPostList::open_position_list() not meaningful");
                 [ #  # ]
      70                 :            : }
      71                 :            : 
      72                 :            : string
      73                 :          0 : GlassAllDocsPostList::get_description() const
      74                 :            : {
      75         [ #  # ]:          0 :     string desc = "GlassAllDocsPostList(did=";
      76 [ #  # ][ #  # ]:          0 :     desc += str(get_docid());
                 [ #  # ]
      77         [ #  # ]:          0 :     desc += ",doccount=";
      78 [ #  # ][ #  # ]:          0 :     desc += str(doccount);
      79         [ #  # ]:          0 :     desc += ')';
      80                 :          0 :     return desc;
      81                 :            : }

Generated by: LCOV version 1.11