23 #ifndef OM_HGUARD_CHERT_CURSOR_H 24 #define OM_HGUARD_CHERT_CURSOR_H 31 #define BLK_UNUSED uint4(-1) 94 enum {
UNREAD, UNCOMPRESSED, COMPRESSED } tag_status;
128 void get_key(
string * key)
const;
168 bool read_tag(
bool keep_compressed =
false);
215 bool find_entry(
const string &key);
219 if (find_entry(key)) prev();
227 bool find_entry_ge(
const string &key);
bool is_positioned
Whether the cursor is positioned at a valid entry.
Cursor & operator=(const Cursor &)
int c
offset in the block's directory
A cursor pointing to a position in a Btree table, for reading several entries in order, or finding approximate matches.
const ChertTable * B
The Btree table.
int level
The value of level in the Btree structure.
Cursor * C
Pointer to an array of Cursors.
Class managing a Btree table in a Chert database.
void to_end()
Set the cursor to be off the end of the table.
MutableChertCursor(ChertTable *B_)
Create a mutable cursor attached to a Btree.
Types used by chert backend and the Btree manager.
string current_tag
Current tag pointed to by cursor.
bool is_after_end
Whether the cursor is off the end of the table.
Cursor()
Constructor, to initialise important elements.
bool rewrite
true if the block is not the same as on disk, and so needs rewriting
uint8_t * p
pointer to a block
bool after_end() const
Determine whether cursor is off the end of table.
string current_key
Current key pointed to by cursor.
void find_entry_lt(const string &key)
Position the cursor on the highest entry with key < key.
const ChertTable * get_table() const
Return a pointer to the ChertTable we're a cursor for.