23 #ifndef OM_HGUARD_CHERT_CURSOR_H
24 #define OM_HGUARD_CHERT_CURSOR_H
31 #define BLK_UNUSED uint4(-1)
128 void get_key(
string * key)
const;
168 bool read_tag(
bool keep_compressed =
false);
Types used by chert backend and the Btree manager.
A cursor pointing to a position in a Btree table, for reading several entries in order,...
bool after_end() const
Determine whether cursor is off the end of table.
void find_entry_lt(const string &key)
Position the cursor on the highest entry with key < key.
bool is_after_end
Whether the cursor is off the end of the table.
ChertCursor(const ChertCursor &)
Copying not allowed.
void get_key(string *key) const
Get the key.
Cursor * C
Pointer to an array of Cursors.
int level
The value of level in the Btree structure.
const ChertTable * get_table() const
Return a pointer to the ChertTable we're a cursor for.
bool is_positioned
Whether the cursor is positioned at a valid entry.
void to_end()
Set the cursor to be off the end of the table.
ChertCursor & operator=(const ChertCursor &)
Assignment not allowed.
enum ChertCursor::@1 tag_status
Status of the current_tag member.
string current_tag
Current tag pointed to by cursor.
bool read_tag(bool keep_compressed=false)
Read the tag from the table and store it in current_tag.
bool find_entry(const string &key)
Position the cursor on the highest entry with key <= key.
bool find_entry_ge(const string &key)
Position the cursor on the lowest entry with key >= key.
bool prev()
Move to the previous key.
const ChertTable * B
The Btree table.
void rebuild()
Rebuild the cursor.
bool next()
Advance to the next key.
string current_key
Current key pointed to by cursor.
~ChertCursor()
Destroy the ChertCursor.
Class managing a Btree table in a Chert database.
uint8_t * p
pointer to a block
Cursor()
Constructor, to initialise important elements.
Cursor & operator=(const Cursor &)
int c
offset in the block's directory
bool rewrite
true if the block is not the same as on disk, and so needs rewriting
MutableChertCursor(ChertTable *B_)
Create a mutable cursor attached to a Btree.
bool del()
Delete the current key/tag pair, leaving the cursor on the next entry.