upscaledb
2.1.13
|
#include <upscaledb.hpp>
Public Member Functions | |
db () | |
~db () | |
db & | operator= (const db &other) |
void | set_compare_func (ups_compare_func_t foo) |
record | find (txn *t, key *k, uint32_t flags=0) |
record & | find (txn *t, key *k, record *r, uint32_t flags=0) |
record | find (key *k, uint32_t flags=0) |
void | insert (txn *t, key *k, record *r, uint32_t flags=0) |
void | insert (key *k, record *r, uint32_t flags=0) |
void | erase (key *k, uint32_t flags=0) |
void | erase (txn *t, key *k, uint32_t flags=0) |
uint64_t | count (ups_txn_t *txn=0, uint32_t flags=0) |
void | get_parameters (ups_parameter_t *param) |
void | close (uint32_t flags=0) |
ups_db_t * | get_handle () |
Static Public Member Functions | |
static void | set_errhandler (ups_error_handler_fun f) |
static void | get_version (uint32_t *major, uint32_t *minor, uint32_t *revision) |
Protected Member Functions | |
db (ups_db_t *db) | |
Private Attributes | |
ups_db_t * | m_db |
Friends | |
class | env |
A Database class.
This class wraps the ups_db_t Database handles.
Definition at line 273 of file upscaledb.hpp.
|
inline |
Constructor
Definition at line 287 of file upscaledb.hpp.
|
inline |
Destructor - automatically closes the Database, if necessary.
!! Any exception is silently discarded. Use of the destructor to clean up open databases is therefore not recommended, because there are valid reasons why an Exception can be thrown (i.e. not all Cursors of this database were closed).
An assert() was added to catch this condition in debug builds.
Definition at line 302 of file upscaledb.hpp.
References close(), and upscaledb::error::get_errno().
|
inlineprotected |
Definition at line 429 of file upscaledb.hpp.
|
inline |
Closes the Database.
Definition at line 408 of file upscaledb.hpp.
References error(), m_db, UPS_AUTO_CLEANUP, and ups_db_close().
Referenced by operator=(), run_demo(), and ~db().
Returns number of items in the Database.
Definition at line 392 of file upscaledb.hpp.
References error(), m_db, and ups_db_count().
Erases a key/record pair.
Definition at line 383 of file upscaledb.hpp.
References error(), upscaledb::key::get_handle(), upscaledb::txn::get_handle(), m_db, and ups_db_erase().
Finds a record by looking up the key.
Definition at line 335 of file upscaledb.hpp.
References error(), upscaledb::key::get_handle(), upscaledb::record::get_handle(), upscaledb::txn::get_handle(), m_db, and ups_db_find().
Referenced by find(), and run_demo().
Finds a record by looking up the key.
Definition at line 347 of file upscaledb.hpp.
References error(), upscaledb::key::get_handle(), upscaledb::record::get_handle(), upscaledb::txn::get_handle(), m_db, and ups_db_find().
Finds a record by looking up the key.
Definition at line 358 of file upscaledb.hpp.
References find().
|
inline |
Returns a pointer to the internal ups_db_t structure.
Definition at line 421 of file upscaledb.hpp.
References m_db.
Referenced by upscaledb::cursor::create().
|
inline |
Retrieves Database parameters.
Definition at line 401 of file upscaledb.hpp.
References error(), m_db, and ups_db_get_parameters().
|
inlinestatic |
Retrieves the upscaledb library version.
Definition at line 281 of file upscaledb.hpp.
References ups_get_version().
Inserts a key/record pair.
Definition at line 363 of file upscaledb.hpp.
References error(), upscaledb::key::get_handle(), upscaledb::record::get_handle(), upscaledb::txn::get_handle(), m_db, and ups_db_insert().
Referenced by insert(), and run_demo().
Assignment operator.
Important! This operator transfers the ownership of the Database handle.
Definition at line 317 of file upscaledb.hpp.
|
inline |
Sets the comparison function.
Definition at line 328 of file upscaledb.hpp.
References error(), m_db, and ups_db_set_compare_func().
|
inlinestatic |
Set error handler function.
Definition at line 276 of file upscaledb.hpp.
References ups_set_error_handler().
|
friend |
Definition at line 426 of file upscaledb.hpp.
|
private |
Definition at line 434 of file upscaledb.hpp.
Referenced by close(), count(), erase(), find(), get_handle(), get_parameters(), insert(), operator=(), and set_compare_func().