xapian-core  1.4.26
Public Member Functions | List of all members
MutableChertCursor Class Reference

#include <chert_cursor.h>

+ Inheritance diagram for MutableChertCursor:
+ Collaboration diagram for MutableChertCursor:

Public Member Functions

 MutableChertCursor (ChertTable *B_)
 Create a mutable cursor attached to a Btree. More...
 
bool del ()
 Delete the current key/tag pair, leaving the cursor on the next entry. More...
 
- Public Member Functions inherited from ChertCursor
 ChertCursor (const ChertTable *B)
 Create a cursor attached to a Btree. More...
 
 ~ChertCursor ()
 Destroy the ChertCursor. More...
 
bool read_tag (bool keep_compressed=false)
 Read the tag from the table and store it in current_tag. More...
 
bool next ()
 Advance to the next key. More...
 
bool prev ()
 Move to the previous key. More...
 
bool find_entry (const string &key)
 Position the cursor on the highest entry with key <= key. More...
 
void find_entry_lt (const string &key)
 Position the cursor on the highest entry with key < key. More...
 
bool find_entry_ge (const string &key)
 Position the cursor on the lowest entry with key >= key. More...
 
void to_end ()
 Set the cursor to be off the end of the table. More...
 
bool after_end () const
 Determine whether cursor is off the end of table. More...
 
const ChertTableget_table () const
 Return a pointer to the ChertTable we're a cursor for. More...
 

Additional Inherited Members

- Public Attributes inherited from ChertCursor
string current_key
 Current key pointed to by cursor. More...
 
string current_tag
 Current tag pointed to by cursor. More...
 
- Protected Attributes inherited from ChertCursor
bool is_positioned
 Whether the cursor is positioned at a valid entry. More...
 
bool is_after_end
 Whether the cursor is off the end of the table. More...
 
const ChertTableB
 The Btree table. More...
 

Detailed Description

Definition at line 244 of file chert_cursor.h.

Constructor & Destructor Documentation

◆ MutableChertCursor()

MutableChertCursor::MutableChertCursor ( ChertTable B_)
inlineexplicit

Create a mutable cursor attached to a Btree.

A mutable cursor allows the items to be deleted.

Creates a cursor, which can be used to remember a position inside the B-tree. The position is simply the item (key and tag) to which the cursor points. A cursor is either positioned or unpositioned, and is initially unpositioned.

NB: You must not try to use a MutableChertCursor after the Btree it is attached to is destroyed. It's safe to destroy the MutableChertCursor after the Btree though, you just may not use the MutableChertCursor.

Definition at line 259 of file chert_cursor.h.

Member Function Documentation

◆ del()

bool MutableChertCursor::del ( )

Delete the current key/tag pair, leaving the cursor on the next entry.

Returns
false if the cursor ends up unpositioned.

Definition at line 316 of file chert_cursor.cc.

References Assert, ChertCursor::B, ChertCursor::current_key, ChertCursor::find_entry_ge(), ChertCursor::is_after_end, ChertCursor::is_positioned, and ChertCursor::next().

Referenced by ChertPostListTable::merge_changes().


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