backends/inmemory/inmemory_alltermslist.h

Go to the documentation of this file.
00001 /* inmemory_alltermslist.h
00002  *
00003  * ----START-LICENCE----
00004  * Copyright 1999,2000,2001 BrightStation PLC
00005  * Copyright 2003 Olly Betts
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License as
00009  * published by the Free Software Foundation; either version 2 of the
00010  * License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00020  * USA
00021  * -----END-LICENCE-----
00022  */
00023 
00024 #ifndef OM_HGUARD_INMEMORY_ALLTERMSLIST_H
00025 #define OM_HGUARD_INMEMORY_ALLTERMSLIST_H
00026 
00027 #include "alltermslist.h"
00028 #include "inmemory_database.h"
00029 
00031 class InMemoryAllTermsList : public AllTermsList
00032 {
00033     private:
00035         InMemoryAllTermsList(const InMemoryAllTermsList &);
00036 
00038         void operator=(const InMemoryAllTermsList &);
00039 
00040         const std::map<string, InMemoryTerm> *tmap;
00041 
00042         std::map<string, InMemoryTerm>::const_iterator it;
00043 
00044         Xapian::Internal::RefCntPtr<const InMemoryDatabase> database;
00045 
00046         bool started;
00047 
00048         string prefix;
00049     public:
00051         InMemoryAllTermsList(const std::map<string, InMemoryTerm> *tmap_,
00052                              Xapian::Internal::RefCntPtr<const InMemoryDatabase> database_,
00053                              const string & prefix);
00054 
00056         ~InMemoryAllTermsList();
00057 
00058         // Gets current termname
00059         string get_termname() const;
00060 
00061         // Get num of docs indexed by term
00062         Xapian::doccount get_termfreq() const;
00063 
00064         // Get num of docs indexed by term
00065         Xapian::termcount get_collection_freq() const;
00066 
00067         TermList * skip_to(const string &tname);
00068 
00071         TermList * next();
00072 
00073         // True if we're off the end of the list
00074         bool at_end() const;
00075 };
00076 
00077 #endif /* OM_HGUARD_INMEMORY_ALLTERMSLIST_H */

Documentation for Xapian (version 1.0.10).
Generated on 24 Dec 2008 by Doxygen 1.5.2.