xapian-core  1.4.21
Public Member Functions | Private Member Functions | Private Attributes | List of all members
GlassValueList Class Reference

Glass class for value streams. More...

#include <glass_valuelist.h>

+ Inheritance diagram for GlassValueList:
+ Collaboration diagram for GlassValueList:

Public Member Functions

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

Private Member Functions

void operator= (const GlassValueList &)
 Don't allow assignment. More...
 
 GlassValueList (const GlassValueList &)
 Don't allow copying. More...
 
bool update_reader ()
 Update reader to use the chunk currently pointed to by cursor. More...
 

Private Attributes

GlassCursorcursor
 
Glass::ValueChunkReader reader
 
Xapian::valueno slot
 
Xapian::Internal::intrusive_ptr< const GlassDatabasedb
 

Additional Inherited Members

- Public Attributes inherited from Xapian::Internal::intrusive_base
unsigned _refs
 Reference count. More...
 
- Protected Member Functions inherited from Xapian::ValueIterator::Internal
 Internal ()
 Only constructable as a base class for derived classes. More...
 

Detailed Description

Glass class for value streams.

Definition at line 31 of file glass_valuelist.h.

Constructor & Destructor Documentation

◆ GlassValueList() [1/2]

GlassValueList::GlassValueList ( const GlassValueList )
private

Don't allow copying.

◆ GlassValueList() [2/2]

GlassValueList::GlassValueList ( Xapian::valueno  slot_,
Xapian::Internal::intrusive_ptr< const GlassDatabase db_ 
)
inline

◆ ~GlassValueList()

GlassValueList::~GlassValueList ( )

Definition at line 45 of file glass_valuelist.cc.

Referenced by GlassValueList().

Member Function Documentation

◆ at_end()

bool GlassValueList::at_end ( ) const
virtual

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

Implements Xapian::ValueIterator::Internal.

Definition at line 71 of file glass_valuelist.cc.

Referenced by GlassValueList().

◆ check()

bool GlassValueList::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 from Xapian::ValueIterator::Internal.

Definition at line 133 of file glass_valuelist.cc.

References Assert, and Glass::make_valuechunk_key().

Referenced by GlassValueList().

◆ get_description()

string GlassValueList::get_description ( ) const
virtual

Return a string description of this object.

Implements Xapian::ValueIterator::Internal.

Definition at line 166 of file glass_valuelist.cc.

References Xapian::Internal::str().

Referenced by GlassValueList().

◆ get_docid()

Xapian::docid GlassValueList::get_docid ( ) const
virtual

Return the docid at the current position.

Implements Xapian::ValueIterator::Internal.

Definition at line 51 of file glass_valuelist.cc.

References Assert.

Referenced by GlassValueList().

◆ get_value()

std::string GlassValueList::get_value ( ) const
virtual

Return the value at the current position.

Implements Xapian::ValueIterator::Internal.

Definition at line 64 of file glass_valuelist.cc.

References Assert.

Referenced by GlassValueList().

◆ get_valueno()

Xapian::valueno GlassValueList::get_valueno ( ) const
virtual

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

Implements Xapian::ValueIterator::Internal.

Definition at line 58 of file glass_valuelist.cc.

Referenced by GlassValueList().

◆ next()

void GlassValueList::next ( )
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.

Implements Xapian::ValueIterator::Internal.

Definition at line 77 of file glass_valuelist.cc.

References Glass::make_valuechunk_key().

Referenced by GlassValueList().

◆ operator=()

void GlassValueList::operator= ( const GlassValueList )
private

Don't allow assignment.

◆ skip_to()

void GlassValueList::skip_to ( Xapian::docid  )
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).

Implements Xapian::ValueIterator::Internal.

Definition at line 101 of file glass_valuelist.cc.

References Glass::make_valuechunk_key().

Referenced by GlassValueList().

◆ update_reader()

bool GlassValueList::update_reader ( )
private

Update reader to use the chunk currently pointed to by cursor.

Definition at line 34 of file glass_valuelist.cc.

References Glass::docid_from_key().

Member Data Documentation

◆ cursor

GlassCursor* GlassValueList::cursor
private

Definition at line 38 of file glass_valuelist.h.

◆ db

Xapian::Internal::intrusive_ptr<const GlassDatabase> GlassValueList::db
private

Definition at line 44 of file glass_valuelist.h.

◆ reader

Glass::ValueChunkReader GlassValueList::reader
private

Definition at line 40 of file glass_valuelist.h.

◆ slot

Xapian::valueno GlassValueList::slot
private

Definition at line 42 of file glass_valuelist.h.


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