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

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

Generated by: LCOV version 1.8