LCOV - code coverage report
Current view: top level - backends/inmemory - inmemory_alltermslist.h (source / functions) Hit Total Coverage
Test: Test Coverage for xapian-core 7028d852e609 Lines: 5 5 100.0 %
Date: 2019-02-17 14:59:59 Functions: 2 2 100.0 %
Branches: 2 4 50.0 %

           Branch data     Line data    Source code
       1                 :            : /** @file inmemory_alltermslist.h
       2                 :            :  * @brief Iterate all terms in an inmemory db
       3                 :            :  */
       4                 :            : /* Copyright 1999,2000,2001 BrightStation PLC
       5                 :            :  * Copyright 2003,2008,2009,2011,2017 Olly Betts
       6                 :            :  *
       7                 :            :  * This program is free software; you can redistribute it and/or
       8                 :            :  * modify it under the terms of the GNU General Public License as
       9                 :            :  * published by the Free Software Foundation; either version 2 of the
      10                 :            :  * License, or (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
      20                 :            :  * USA
      21                 :            :  */
      22                 :            : 
      23                 :            : #ifndef XAPIAN_INCLUDED_INMEMORY_ALLTERMSLIST_H
      24                 :            : #define XAPIAN_INCLUDED_INMEMORY_ALLTERMSLIST_H
      25                 :            : 
      26                 :            : #include "backends/alltermslist.h"
      27                 :            : #include "inmemory_database.h"
      28                 :            : 
      29                 :            : /** class for alltermslists over several databases */
      30         [ -  + ]:        428 : class InMemoryAllTermsList : public AllTermsList
      31                 :            : {
      32                 :            :     private:
      33                 :            :         /// Copying is not allowed.
      34                 :            :         InMemoryAllTermsList(const InMemoryAllTermsList &);
      35                 :            : 
      36                 :            :         /// Assignment is not allowed.
      37                 :            :         void operator=(const InMemoryAllTermsList &);
      38                 :            : 
      39                 :            :         const std::map<string, InMemoryTerm> *tmap;
      40                 :            : 
      41                 :            :         std::map<string, InMemoryTerm>::const_iterator it;
      42                 :            : 
      43                 :            :         Xapian::Internal::intrusive_ptr<const InMemoryDatabase> database;
      44                 :            : 
      45                 :            :         string prefix;
      46                 :            : 
      47                 :            :     public:
      48                 :            :         /// Constructor.
      49                 :        107 :         InMemoryAllTermsList(const std::map<string, InMemoryTerm> *tmap_,
      50                 :            :                              Xapian::Internal::intrusive_ptr<const InMemoryDatabase> database_,
      51                 :            :                              const string & prefix_)
      52                 :        107 :             : tmap(tmap_), it(tmap->begin()), database(database_),
      53         [ +  - ]:        107 :               prefix(prefix_)
      54                 :            :         {
      55                 :        107 :         }
      56                 :            : 
      57                 :            :         Xapian::termcount get_approx_size() const;
      58                 :            : 
      59                 :            :         // Gets current termname
      60                 :            :         string get_termname() const;
      61                 :            : 
      62                 :            :         // Get num of docs indexed by term
      63                 :            :         Xapian::doccount get_termfreq() const;
      64                 :            : 
      65                 :            :         // Get num of docs indexed by term
      66                 :            :         Xapian::termcount get_collection_freq() const;
      67                 :            : 
      68                 :            :         TermList * skip_to(const string &tname);
      69                 :            : 
      70                 :            :         /** next() causes the AllTermsList to move to the next term in the list.
      71                 :            :          */
      72                 :            :         TermList * next();
      73                 :            : 
      74                 :            :         // True if we're off the end of the list
      75                 :            :         bool at_end() const;
      76                 :            : };
      77                 :            : 
      78                 :            : #ifdef DISABLE_GPL_LIBXAPIAN
      79                 :            : # error GPL source we cannot relicense included in libxapian
      80                 :            : #endif
      81                 :            : 
      82                 :            : #endif /* XAPIAN_INCLUDED_INMEMORY_ALLTERMSLIST_H */

Generated by: LCOV version 1.11