hamsterdb Embedded Database 1.1.15
|
#include <hamsterdb.hpp>
Public Member Functions | |
cursor (db *db=0, txn *t=0, ham_u32_t flags=0) | |
cursor (txn *t, db *db=0, ham_u32_t flags=0) | |
~cursor () | |
void | create (db *db, txn *t=0, ham_u32_t flags=0) |
cursor | clone () |
void | move (key *k, record *r, ham_u32_t flags=0) |
void | move_first (key *k=0, record *r=0) |
void | move_last (key *k=0, record *r=0) |
void | move_next (key *k=0, record *r=0) |
void | move_previous (key *k=0, record *r=0) |
void | overwrite (record *r, ham_u32_t flags=0) |
void | find (key *k, ham_u32_t flags=0) |
void | find_ex (key *k, record *r, ham_u32_t flags=0) |
void | insert (key *k, record *r, ham_u32_t flags=0) |
void | erase (ham_u32_t flags=0) |
ham_u32_t | get_duplicate_count (ham_u32_t flags=0) |
ham_u64_t | get_record_size () |
void | close () |
Protected Member Functions | |
cursor (ham_cursor_t *c) | |
Private Attributes | |
ham_cursor_t * | m_cursor |
A Database Cursor.
This class wraps the ham_cursor_t Cursor handles.
Definition at line 487 of file hamsterdb.hpp.
Constructor
Definition at line 491 of file hamsterdb.hpp.
References create().
Referenced by clone().
ham::cursor::~cursor | ( | ) | [inline] |
Destructor - automatically closes the Cursor, if necessary.
Definition at line 503 of file hamsterdb.hpp.
References close().
ham::cursor::cursor | ( | ham_cursor_t * | c | ) | [inline, protected] |
Definition at line 625 of file hamsterdb.hpp.
References m_cursor.
cursor ham::cursor::clone | ( | ) | [inline] |
Clones the Cursor.
Definition at line 521 of file hamsterdb.hpp.
References cursor(), error(), ham_cursor_clone(), and m_cursor.
void ham::cursor::close | ( | ) | [inline] |
Closes the Cursor.
Definition at line 614 of file hamsterdb.hpp.
References error(), ham_cursor_close(), and m_cursor.
Creates a new Cursor.
Definition at line 508 of file hamsterdb.hpp.
References close(), error(), ham::db::get_handle(), ham_cursor_create(), and m_cursor.
Referenced by cursor(), and run_demo().
void ham::cursor::erase | ( | ham_u32_t | flags = 0 | ) | [inline] |
Erases the current key/record pair.
Definition at line 589 of file hamsterdb.hpp.
References error(), ham_cursor_erase(), and m_cursor.
Finds a key.
Definition at line 566 of file hamsterdb.hpp.
References error(), ham::key::get_handle(), ham_cursor_find(), and m_cursor.
Referenced by run_demo().
Finds a key.
Definition at line 573 of file hamsterdb.hpp.
References error(), ham::record::get_handle(), ham::key::get_handle(), ham_cursor_find_ex(), and m_cursor.
Returns the number of duplicate keys.
Definition at line 596 of file hamsterdb.hpp.
References error(), ham_cursor_get_duplicate_count(), and m_cursor.
ham_u64_t ham::cursor::get_record_size | ( | ) | [inline] |
Returns the size of the current record.
Definition at line 605 of file hamsterdb.hpp.
References error(), ham_cursor_get_record_size(), and m_cursor.
Inserts a key/record pair.
Definition at line 581 of file hamsterdb.hpp.
References error(), ham::record::get_handle(), ham::key::get_handle(), ham_cursor_insert(), and m_cursor.
Moves the Cursor, and retrieves the key/record of the new position.
Definition at line 530 of file hamsterdb.hpp.
References error(), ham::record::get_handle(), ham::key::get_handle(), ham_cursor_move(), and m_cursor.
Referenced by move_first(), move_last(), move_next(), move_previous(), and run_demo().
Moves the Cursor to the first Database element.
Definition at line 538 of file hamsterdb.hpp.
References HAM_CURSOR_FIRST, and move().
Moves the Cursor to the last Database element.
Definition at line 543 of file hamsterdb.hpp.
References HAM_CURSOR_LAST, and move().
Moves the Cursor to the next Database element.
Definition at line 548 of file hamsterdb.hpp.
References HAM_CURSOR_NEXT, and move().
Referenced by run_demo().
Moves the Cursor to the previous Database element.
Definition at line 553 of file hamsterdb.hpp.
References HAM_CURSOR_PREVIOUS, and move().
Overwrites the current record.
Definition at line 558 of file hamsterdb.hpp.
References error(), ham::record::get_handle(), ham_cursor_overwrite(), and m_cursor.
ham_cursor_t* ham::cursor::m_cursor [private] |
Definition at line 630 of file hamsterdb.hpp.
Referenced by clone(), close(), create(), cursor(), erase(), find(), find_ex(), get_duplicate_count(), get_record_size(), insert(), move(), and overwrite().