Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
Xapian::ValueIterator::Internal Class Reference

Abstract base class for value streams. More...

#include <valuelist.h>

+ Inheritance diagram for Xapian::ValueIterator::Internal:
+ Collaboration diagram for Xapian::ValueIterator::Internal:

Public Member Functions

virtual ~Internal ()
 We have virtual methods and want to be able to delete derived classes using a pointer to the base class, so we need a virtual destructor.
virtual Xapian::docid get_docid () const =0
 Return the docid at the current position.
virtual std::string get_value () const =0
 Return the value at the current position.
virtual Xapian::valueno get_valueno () const =0
 Return the value slot for the current position/this iterator.
virtual bool at_end () const =0
 Return true if the current position is past the last entry in this list.
virtual void next ()=0
 Advance the current position to the next document in the value stream.
virtual void skip_to (Xapian::docid)=0
 Skip forward to the specified docid.
virtual bool check (Xapian::docid did)
 Check if the specified docid occurs in this valuestream.
virtual std::string get_description () const =0
 Return a string description of this object.
- Public Member Functions inherited from Xapian::Internal::RefCntBase
 RefCntBase ()
 The constructor, which initialises the ref_count to 0.

Protected Member Functions

 Internal ()
 Only constructable as a base class for derived classes.
- Protected Member Functions inherited from Xapian::Internal::RefCntBase
 RefCntBase (const RefCntBase &)
 The copy constructor.

Private Member Functions

void operator= (const Internal &)
 Don't allow assignment.
 Internal (const Internal &)
 Don't allow copying.

Additional Inherited Members

- Public Types inherited from Xapian::Internal::RefCntBase
typedef unsigned int ref_count_t
- Public Attributes inherited from Xapian::Internal::RefCntBase
ref_count_t ref_count
 The actual reference count.

Detailed Description

Abstract base class for value streams.

Definition at line 31 of file valuelist.h.

Constructor & Destructor Documentation

Xapian::ValueIterator::Internal::Internal ( const Internal )
private

Don't allow copying.

Xapian::ValueIterator::Internal::Internal ( )
inlineprotected

Only constructable as a base class for derived classes.

Definition at line 40 of file valuelist.h.

Xapian::ValueIterator::Internal::~Internal ( )
virtual

We have virtual methods and want to be able to delete derived classes using a pointer to the base class, so we need a virtual destructor.

Definition at line 27 of file valuelist.cc.

Member Function Documentation

virtual bool Xapian::ValueIterator::Internal::at_end ( ) const
pure virtual
bool Xapian::ValueIterator::Internal::check ( Xapian::docid  did)
virtual

Check if the specified docid occurs in this valuestream.

The caller is required to ensure that the specified docid actually exists in the database.

This method acts like skip_to() if that can be done at little extra cost, in which case it then returns true.

Otherwise it simply checks if a particular docid is present. If it is, it returns true. If it isn't, it returns false, and leaves the position unspecified (and hence the result of calling methods which depends on the current position, such as get_docid(), are also unspecified). In this state, next() will advance to the first matching position after docid, and skip_to() will act as it would if the position was the first matching position after docid.

The default implementation calls skip_to().

Reimplemented in MultiValueList, SlowValueList, BrassValueList, and ChertValueList.

Definition at line 30 of file valuelist.cc.

References Xapian::ValueIterator::skip_to().

Referenced by Xapian::ValueIterator::check(), and ValueStreamDocument::do_get_value().

virtual std::string Xapian::ValueIterator::Internal::get_description ( ) const
pure virtual

Return a string description of this object.

Implemented in MultiValueList, SlowValueList, BrassValueList, ChertValueList, and DocumentValueList.

virtual Xapian::docid Xapian::ValueIterator::Internal::get_docid ( ) const
pure virtual

Return the docid at the current position.

Implemented in MultiValueList, SlowValueList, BrassValueList, ChertValueList, and DocumentValueList.

Referenced by ValueStreamDocument::do_get_value(), and Xapian::ValueIterator::get_docid().

virtual std::string Xapian::ValueIterator::Internal::get_value ( ) const
pure virtual

Return the value at the current position.

Implemented in MultiValueList, SlowValueList, BrassValueList, ChertValueList, and DocumentValueList.

Referenced by ValueStreamDocument::do_get_value(), and Xapian::ValueIterator::operator*().

virtual Xapian::valueno Xapian::ValueIterator::Internal::get_valueno ( ) const
pure virtual

Return the value slot for the current position/this iterator.

Implemented in MultiValueList, SlowValueList, BrassValueList, ChertValueList, and DocumentValueList.

Referenced by Xapian::ValueIterator::get_valueno().

virtual void Xapian::ValueIterator::Internal::next ( )
pure virtual

Advance the current position to the next document in the value stream.

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

Implemented in MultiValueList, SlowValueList, BrassValueList, ChertValueList, and DocumentValueList.

void Xapian::ValueIterator::Internal::operator= ( const Internal )
private

Don't allow assignment.

virtual void Xapian::ValueIterator::Internal::skip_to ( Xapian::docid  )
pure virtual

Skip forward to the specified docid.

If the specified docid isn't in the list, position ourselves on the first document after it (or at_end() if no greater docids are present).

Implemented in MultiValueList, SlowValueList, BrassValueList, ChertValueList, and DocumentValueList.


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

Documentation for Xapian (version 1.2.19).
Generated on Tue Oct 21 2014 by Doxygen 1.8.1.2.