33 #ifndef UPS_UPSCALEDB_HPP 34 #define UPS_UPSCALEDB_HPP 42 #if defined(_MSC_VER) && defined(_DEBUG) && !defined(_CRTDBG_MAP_ALLOC) 43 # define _CRTDBG_MAP_ALLOC 96 ::memset(&_key, 0,
sizeof(_key));
169 memset(&_record, 0,
sizeof(_record));
172 _record.flags = flags;
177 : _record(other._record) {
208 return _record.flags;
213 _record.flags = flags;
317 db &rhs = (
db &)other;
354 return find(0, k, flags);
367 insert(0, k, r, flags);
441 create(
db, t, flags);
447 create(
db, t, flags);
475 t ? t->get_handle() : 0, flags);
529 (r ? r->get_handle() : 0), flags);
714 std::vector<uint16_t> v(count);
740 #endif // UPS_UPSCALEDB_HPP UPS_EXPORT ups_status_t UPS_CALLCONV ups_env_get_parameters(ups_env_t *env, ups_parameter_t *param)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_cursor_get_duplicate_count(ups_cursor_t *cursor, uint32_t *count, uint32_t flags)
cursor(db *db=0, txn *t=0, uint32_t flags=0)
uint32_t get_record_size()
struct ups_txn_t ups_txn_t
void move_previous(key *k=0, record *r=0)
db & operator=(const db &other)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_env_open(ups_env_t **env, const char *filename, uint32_t flags, const ups_parameter_t *param)
UPS_EXPORT const char *UPS_CALLCONV ups_strerror(ups_status_t status)
record & find(txn *t, key *k, record *r, uint32_t flags=0)
#define UPS_LIMITS_REACHED
void create(const char *filename, uint32_t flags=0, uint32_t mode=0644, const ups_parameter_t *param=0)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_env_close(ups_env_t *env, uint32_t flags)
void set_size(uint32_t size)
void insert(key *k, record *r, uint32_t flags=0)
void erase(key *k, uint32_t flags=0)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_db_erase(ups_db_t *db, ups_txn_t *txn, ups_key_t *key, uint32_t flags)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_db_insert(ups_db_t *db, ups_txn_t *txn, ups_key_t *key, ups_record_t *record, uint32_t flags)
unsigned __int64 uint64_t
#define UPS_CURSOR_PREVIOUS
ups_record_t * get_handle()
Internal upscaledb functions.
UPS_EXPORT ups_status_t UPS_CALLCONV ups_cursor_clone(ups_cursor_t *src, ups_cursor_t **dest)
int UPS_CALLCONV(* ups_compare_func_t)(ups_db_t *db, const uint8_t *lhs, uint32_t lhs_length, const uint8_t *rhs, uint32_t rhs_length)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_db_find(ups_db_t *db, ups_txn_t *txn, ups_key_t *key, ups_record_t *record, uint32_t flags)
void UPS_CALLCONV(* ups_error_handler_fun)(int level, const char *message)
uint16_t get_size() const
ups_status_t get_errno() const
record & operator=(const record &other)
void get_parameters(ups_parameter_t *param)
std::vector< uint16_t > get_database_names()
UPS_EXPORT ups_status_t UPS_CALLCONV ups_cursor_move(ups_cursor_t *cursor, ups_key_t *key, ups_record_t *record, uint32_t flags)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_env_erase_db(ups_env_t *env, uint16_t name, uint32_t flags)
static void get_version(uint32_t *major, uint32_t *minor, uint32_t *revision)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_env_rename_db(ups_env_t *env, uint16_t oldname, uint16_t newname, uint32_t flags)
void insert(key *k, record *r, uint32_t flags=0)
record find(key *k, uint32_t flags=0)
db create_db(uint16_t name, uint32_t flags=0, const ups_parameter_t *param=0)
uint32_t get_size() const
Include file for upscaledb embedded database.
UPS_EXPORT ups_status_t UPS_CALLCONV ups_cursor_find(ups_cursor_t *cursor, ups_key_t *key, ups_record_t *record, uint32_t flags)
void close(uint32_t flags=0)
key & operator=(const key &other)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_db_count(ups_db_t *db, ups_txn_t *txn, uint32_t flags, uint64_t *count)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_db_get_parameters(ups_db_t *db, ups_parameter_t *param)
void insert(txn *t, key *k, record *r, uint32_t flags=0)
uint32_t get_flags() const
UPS_EXPORT const char * ups_txn_get_name(ups_txn_t *txn)
uint32_t get_flags() const
const char * get_string() const
struct ups_cursor_t ups_cursor_t
void move(key *k, record *r, uint32_t flags=0)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_env_flush(ups_env_t *env, uint32_t flags)
void move_next(key *k=0, record *r=0)
uint64_t count(ups_txn_t *txn=0, uint32_t flags=0)
cursor(txn *t, db *db=0, uint32_t flags=0)
void set_size(uint16_t size)
record(void *data=0, uint32_t size=0, uint32_t flags=0)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_cursor_close(ups_cursor_t *cursor)
void set_flags(uint32_t flags)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_cursor_overwrite(ups_cursor_t *cursor, ups_record_t *record, uint32_t flags)
void flush(uint32_t flags=0)
uint32_t get_duplicate_count(uint32_t flags=0)
void set_compare_func(ups_compare_func_t foo)
void erase_db(uint16_t name, uint32_t flags=0)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_env_open_db(ups_env_t *env, ups_db_t **db, uint16_t name, uint32_t flags, const ups_parameter_t *params)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_env_create(ups_env_t **env, const char *filename, uint32_t flags, uint32_t mode, const ups_parameter_t *param)
UPS_EXPORT ups_status_t ups_txn_begin(ups_txn_t **txn, ups_env_t *env, const char *name, void *reserved, uint32_t flags)
UPS_EXPORT ups_status_t ups_txn_commit(ups_txn_t *txn, uint32_t flags)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_cursor_insert(ups_cursor_t *cursor, ups_key_t *key, ups_record_t *record, uint32_t flags)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_cursor_erase(ups_cursor_t *cursor, uint32_t flags)
void create(db *db, txn *t=0, uint32_t flags=0)
void set_data(void *data)
record find(txn *t, key *k, uint32_t flags=0)
void overwrite(record *r, uint32_t flags=0)
void move_first(key *k=0, record *r=0)
void close(uint32_t flags=0)
void rename_db(uint16_t oldname, uint16_t newname, uint32_t flags=0)
void open(const char *filename, uint32_t flags=0, const ups_parameter_t *param=0)
db open_db(uint16_t name, uint32_t flags=0, const ups_parameter_t *param=0)
UPS_EXPORT ups_status_t ups_txn_abort(ups_txn_t *txn, uint32_t flags)
void set_data(void *data)
UPS_EXPORT void UPS_CALLCONV ups_set_error_handler(ups_error_handler_fun f)
void erase(uint32_t flags=0)
key(void *data=0, uint16_t size=0, uint32_t flags=0)
void find(key *k, record *r=0, uint32_t flags=0)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_db_set_compare_func(ups_db_t *db, ups_compare_func_t foo)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_env_create_db(ups_env_t *env, ups_db_t **db, uint16_t name, uint32_t flags, const ups_parameter_t *params)
record(const record &other)
void set_flags(uint32_t flags)
static void set_errhandler(ups_error_handler_fun f)
void move_last(key *k=0, record *r=0)
txn begin(const char *name=0, uint32_t flags=0)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_cursor_create(ups_cursor_t **cursor, ups_db_t *db, ups_txn_t *txn, uint32_t flags)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_env_get_database_names(ups_env_t *env, uint16_t *names, uint32_t *length)
void get_parameters(ups_parameter_t *param)
UPS_EXPORT ups_status_t UPS_CALLCONV ups_db_close(ups_db_t *db, uint32_t flags)
void erase(txn *t, key *k, uint32_t flags=0)
UPS_EXPORT void UPS_CALLCONV ups_get_version(uint32_t *major, uint32_t *minor, uint32_t *revision)
struct ups_env_t ups_env_t
UPS_EXPORT ups_status_t UPS_CALLCONV ups_cursor_get_record_size(ups_cursor_t *cursor, uint32_t *size)