InMemoryTermList Class Reference

#include <inmemory_database.h>

Inheritance diagram for InMemoryTermList:

Inheritance graph
[legend]
Collaboration diagram for InMemoryTermList:

Collaboration graph
[legend]

List of all members.

Public Member Functions

Xapian::termcount get_approx_size () const
 Return approximate size of this termlist.
void accumulate_stats (Xapian::Internal::ExpandStats &stats) const
 Collate weighting information for the current term.
string get_termname () const
 Return the termname at the current position.
Xapian::termcount get_wdf () const
 Return the wdf for the term at the current position.
Xapian::doccount get_termfreq () const
 Return the term frequency for the term at the current position.
TermListnext ()
 Advance the current position to the next term in the termlist.
TermListskip_to (const std::string &term)
 Skip forward to the specified term.
bool at_end () const
 Return true if the current position is past the last term in this list.
Xapian::termcount positionlist_count () const
 Return the length of the position list for the current position.
Xapian::PositionIterator positionlist_begin () const
 Return a PositionIterator for the current position.

Private Member Functions

 InMemoryTermList (Xapian::Internal::RefCntPtr< const InMemoryDatabase > db, Xapian::docid did, const InMemoryDoc &doc, Xapian::termcount len)

Private Attributes

vector< InMemoryTermEntry >
::const_iterator 
pos
vector< InMemoryTermEntry >
::const_iterator 
end
Xapian::termcount terms
bool started
Xapian::Internal::RefCntPtr
< const InMemoryDatabase
db
Xapian::docid did
Xapian::termcount document_length

Friends

class InMemoryDatabase


Detailed Description

Definition at line 201 of file inmemory_database.h.


Constructor & Destructor Documentation

InMemoryTermList::InMemoryTermList ( Xapian::Internal::RefCntPtr< const InMemoryDatabase db,
Xapian::docid  did,
const InMemoryDoc doc,
Xapian::termcount  len 
) [private]

Definition at line 185 of file inmemory_database.cc.

References LOGLINE, pos, and terms.


Member Function Documentation

void InMemoryTermList::accumulate_stats ( Xapian::Internal::ExpandStats stats  )  const [virtual]

Collate weighting information for the current term.

Reimplemented from Xapian::TermIterator::Internal.

Definition at line 223 of file inmemory_database.cc.

References Xapian::Internal::ExpandStats::accumulate(), Assert, at_end(), db, document_length, get_termfreq(), get_wdf(), and started.

bool InMemoryTermList::at_end (  )  const [virtual]

Return true if the current position is past the last term in this list.

Implements Xapian::TermIterator::Internal.

Definition at line 270 of file inmemory_database.cc.

References Assert, db, end, pos, and started.

Referenced by accumulate_stats(), get_termfreq(), get_termname(), get_wdf(), and next().

Xapian::termcount InMemoryTermList::get_approx_size (  )  const [virtual]

Return approximate size of this termlist.

Implements Xapian::TermIterator::Internal.

Definition at line 216 of file inmemory_database.cc.

References db, and terms.

Xapian::doccount InMemoryTermList::get_termfreq (  )  const [virtual]

Return the term frequency for the term at the current position.

Implements Xapian::TermIterator::Internal.

Definition at line 206 of file inmemory_database.cc.

References Assert, at_end(), db, and started.

Referenced by accumulate_stats().

string InMemoryTermList::get_termname (  )  const [virtual]

Return the termname at the current position.

Implements Xapian::TermIterator::Internal.

Definition at line 234 of file inmemory_database.cc.

References Assert, at_end(), db, and started.

Xapian::termcount InMemoryTermList::get_wdf (  )  const [virtual]

Return the wdf for the term at the current position.

Implements Xapian::TermIterator::Internal.

Definition at line 197 of file inmemory_database.cc.

References Assert, at_end(), db, and started.

Referenced by accumulate_stats().

TermList * InMemoryTermList::next (  )  [virtual]

Advance the current position to the next term in the termlist.

The list starts before the first term in the list, so next() must be called before any methods which need the context of the current position.

Returns:
If a non-NULL pointer is returned, then the caller should substitute the returned pointer for its pointer to us, and then delete us. This "pruning" can only happen for a non-leaf subclass of this class.

Implements Xapian::TermIterator::Internal.

Definition at line 243 of file inmemory_database.cc.

References Assert, at_end(), db, pos, and started.

Xapian::PositionIterator InMemoryTermList::positionlist_begin (  )  const [virtual]

Return a PositionIterator for the current position.

Implements Xapian::TermIterator::Internal.

Definition at line 285 of file inmemory_database.cc.

References db, and did.

Xapian::termcount InMemoryTermList::positionlist_count (  )  const [virtual]

Return the length of the position list for the current position.

Implements Xapian::TermIterator::Internal.

Definition at line 278 of file inmemory_database.cc.

References db, and did.

TermList * InMemoryTermList::skip_to ( const std::string &  term  )  [virtual]

Skip forward to the specified term.

If the specified term isn't in the list, position ourselves on the first term after tname (or at_end() if no terms after tname exist).

Implements Xapian::TermIterator::Internal.

Definition at line 256 of file inmemory_database.cc.

References db, end, pos, rare, and started.


Friends And Related Function Documentation

friend class InMemoryDatabase [friend]

Definition at line 202 of file inmemory_database.h.


Member Data Documentation

Definition at line 210 of file inmemory_database.h.

Referenced by positionlist_begin(), and positionlist_count().

Definition at line 211 of file inmemory_database.h.

Referenced by accumulate_stats().

vector<InMemoryTermEntry>::const_iterator InMemoryTermList::end [private]

Definition at line 205 of file inmemory_database.h.

Referenced by at_end(), and skip_to().

vector<InMemoryTermEntry>::const_iterator InMemoryTermList::pos [private]

Definition at line 204 of file inmemory_database.h.

Referenced by at_end(), InMemoryTermList(), next(), and skip_to().

bool InMemoryTermList::started [private]

Definition at line 206 of file inmemory_database.h.

Referenced by get_approx_size(), and InMemoryTermList().


The documentation for this class was generated from the following files:

Documentation for Xapian (version 1.2.13).
Generated on 9 Jan 2013 by Doxygen 1.5.9.