xapian-core  1.4.26
Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
Xapian::ValueIterator::Internal Class Referenceabstract

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. More...
 
virtual Xapian::docid get_docid () const =0
 Return the docid at the current position. More...
 
virtual std::string get_value () const =0
 Return the value at the current position. More...
 
virtual Xapian::valueno get_valueno () const =0
 Return the value slot for the current position/this iterator. More...
 
virtual bool at_end () const =0
 Return true if the current position is past the last entry in this list. More...
 
virtual void next ()=0
 Advance the current position to the next document in the value stream. More...
 
virtual void skip_to (Xapian::docid)=0
 Skip forward to the specified docid. More...
 
virtual bool check (Xapian::docid did)
 Check if the specified docid occurs in this valuestream. More...
 
virtual std::string get_description () const =0
 Return a string description of this object. More...
 
- Public Member Functions inherited from Xapian::Internal::intrusive_base
 intrusive_base ()
 Construct with no references. More...
 

Protected Member Functions

 Internal ()
 Only constructable as a base class for derived classes. More...
 

Private Member Functions

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

Additional Inherited Members

- Public Attributes inherited from Xapian::Internal::intrusive_base
unsigned _refs
 Reference count. More...
 

Detailed Description

Abstract base class for value streams.

Definition at line 31 of file valuelist.h.

Constructor & Destructor Documentation

◆ Internal() [1/2]

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

Don't allow copying.

◆ Internal() [2/2]

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

Only constructable as a base class for derived classes.

Definition at line 40 of file valuelist.h.

References at_end(), check(), get_description(), get_docid(), get_value(), get_valueno(), next(), skip_to(), and ~Internal().

◆ ~Internal()

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.

Referenced by Internal().

Member Function Documentation

◆ at_end()

virtual bool Xapian::ValueIterator::Internal::at_end ( ) const
pure virtual

◆ check()

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 depend 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, ChertValueList, and GlassValueList.

Definition at line 30 of file valuelist.cc.

References skip_to().

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

◆ get_description()

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

Return a string description of this object.

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

Referenced by Internal().

◆ get_docid()

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

◆ get_value()

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

◆ get_valueno()

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, ChertValueList, GlassValueList, and DocumentValueList.

Referenced by Xapian::ValueIterator::get_valueno(), and Internal().

◆ next()

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(), skip_to() or check() must be called before any methods which need the context of the current position.

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

Referenced by Internal(), and SubValueList::next().

◆ operator=()

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

Don't allow assignment.

◆ skip_to()

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, ChertValueList, GlassValueList, and DocumentValueList.

Referenced by check(), Internal(), and SubValueList::skip_to().


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