hamsterdb Embedded Database
2.1.7
|
#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, record *r=0, 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 441 of file hamsterdb.hpp.
Constructor
Definition at line 444 of file hamsterdb.hpp.
References create().
Referenced by clone().
|
inline |
Destructor - automatically closes the Cursor, if necessary.
Definition at line 456 of file hamsterdb.hpp.
References close().
|
inlineprotected |
Definition at line 570 of file hamsterdb.hpp.
References m_cursor.
|
inline |
Clones the Cursor.
Definition at line 473 of file hamsterdb.hpp.
References cursor(), error(), ham_cursor_clone(), and m_cursor.
|
inline |
Closes the Cursor.
Definition at line 559 of file hamsterdb.hpp.
References error(), ham_cursor_close(), and m_cursor.
Creates a new Cursor.
Definition at line 461 of file hamsterdb.hpp.
References close(), error(), hamsterdb::db::get_handle(), ham_cursor_create(), and m_cursor.
Referenced by cursor().
|
inline |
Erases the current key/record pair.
Definition at line 534 of file hamsterdb.hpp.
References error(), ham_cursor_erase(), and m_cursor.
Finds a key.
Definition at line 518 of file hamsterdb.hpp.
References error(), hamsterdb::key::get_handle(), ham_cursor_find(), and m_cursor.
Referenced by run_demo().
Returns the number of duplicate keys.
Definition at line 541 of file hamsterdb.hpp.
References error(), ham_cursor_get_duplicate_count(), and m_cursor.
|
inline |
Returns the size of the current record.
Definition at line 550 of file hamsterdb.hpp.
References error(), ham_cursor_get_record_size(), and m_cursor.
Inserts a key/record pair.
Definition at line 526 of file hamsterdb.hpp.
References error(), hamsterdb::key::get_handle(), hamsterdb::record::get_handle(), ham_cursor_insert(), and m_cursor.
Moves the Cursor, and retrieves the key/record of the new position.
Definition at line 482 of file hamsterdb.hpp.
References error(), hamsterdb::key::get_handle(), hamsterdb::record::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 490 of file hamsterdb.hpp.
References HAM_CURSOR_FIRST, and move().
Moves the Cursor to the last Database element.
Definition at line 495 of file hamsterdb.hpp.
References HAM_CURSOR_LAST, and move().
Moves the Cursor to the next Database element.
Definition at line 500 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 505 of file hamsterdb.hpp.
References HAM_CURSOR_PREVIOUS, and move().
Overwrites the current record.
Definition at line 510 of file hamsterdb.hpp.
References error(), hamsterdb::record::get_handle(), ham_cursor_overwrite(), and m_cursor.
|
private |
Definition at line 575 of file hamsterdb.hpp.
Referenced by clone(), close(), create(), cursor(), erase(), find(), get_duplicate_count(), get_record_size(), insert(), move(), and overwrite().