Loading...
Searching...
No Matches
lmdb Namespace Reference

<lmdb++.h> - C++11 wrapper for LMDB. More...

## Classes

class | bad_dbi_error
| Exception class for `MDB_BAD_DBI` errors. More...
class | corrupted_error
| Exception class for `MDB_CORRUPTED` errors. More...
class | cursor
| Resource class for `MDB_cursor*` handles. More...
class | dbi
| Resource class for `MDB_dbi` handles. More...
class | env
| Resource class for `MDB_env*` handles. More...
class | error
| Base class for LMDB exception conditions. More...
class | fatal_error
| Base class for fatal error conditions. More...
class | key_exist_error
| Exception class for `MDB_KEYEXIST` errors. More...
class | logic_error
| Base class for logic error conditions. More...
class | map_full_error
| Exception class for `MDB_MAP_FULL` errors. More...
class | not_found_error
| Exception class for `MDB_NOTFOUND` errors. More...
class | panic_error
| Exception class for `MDB_PANIC` errors. More...
class | runtime_error
| Base class for runtime error conditions. More...
class | txn
| Resource class for `MDB_txn*` handles. More...
class | val
| Wrapper class for `MDB_val` structures. More...
class | version_mismatch_error
| Exception class for `MDB_VERSION_MISMATCH` errors. More...

## Typedefs

using | mode = mdb_mode_t

## Functions

static void | env_create (MDB_env **env)
static void | env_open (MDB_env *env, const char *path, unsigned int flags, mode mode)
static void | env_copy (MDB_env *env, const char *path, unsigned int flags)
static void | env_copy_fd (MDB_env *env, mdb_filehandle_t fd, unsigned int flags)
static void | env_stat (MDB_env *env, MDB_stat *stat)
static void | env_info (MDB_env *env, MDB_envinfo *stat)
static void | env_sync (MDB_env *env, bool force)
static void | env_close (MDB_env *env) noexcept
static void | env_set_flags (MDB_env *env, unsigned int flags, bool onoff)
static void | env_get_flags (MDB_env *env, unsigned int *flags)
static void | env_get_path (MDB_env *env, const char **path)
static void | env_get_fd (MDB_env *env, mdb_filehandle_t *fd)
static void | env_set_mapsize (MDB_env *env, std::size_t size)
static void | env_set_max_readers (MDB_env *env, unsigned int count)
static void | env_get_max_readers (MDB_env *env, unsigned int *count)
static void | env_set_max_dbs (MDB_env *env, MDB_dbi count)
static unsigned int | env_get_max_keysize (MDB_env *env)
static void | env_set_userctx (MDB_env *env, void *ctx)
static void * | env_get_userctx (MDB_env *env)
static void | txn_begin (MDB_env *env, MDB_txn *parent, unsigned int flags, MDB_txn **txn)
static MDB_env * | txn_env (MDB_txn *txn) noexcept
static void | txn_commit (MDB_txn *txn)
static void | txn_abort (MDB_txn *txn) noexcept
static void | txn_reset (MDB_txn *txn) noexcept
static void | txn_renew (MDB_txn *txn)
static void | dbi_open (MDB_txn *txn, const char *name, unsigned int flags, MDB_dbi *dbi)
static void | dbi_stat (MDB_txn *txn, MDB_dbi dbi, MDB_stat *stat)
static void | dbi_flags (MDB_txn *txn, MDB_dbi dbi, unsigned int *flags)
static void | dbi_close (MDB_env *env, MDB_dbi dbi) noexcept
static void | dbi_drop (MDB_txn *txn, MDB_dbi dbi, bool del)
static void | dbi_set_compare (MDB_txn *txn, MDB_dbi dbi, MDB_cmp_func *cmp)
static void | dbi_set_dupsort (MDB_txn *txn, MDB_dbi dbi, MDB_cmp_func *cmp)
static void | dbi_set_relfunc (MDB_txn *txn, MDB_dbi dbi, MDB_rel_func *rel)
static void | dbi_set_relctx (MDB_txn *txn, MDB_dbi dbi, void *ctx)
static bool | dbi_get (MDB_txn *txn, MDB_dbi dbi, const MDB_val *key, MDB_val *data)
static bool | dbi_put (MDB_txn *txn, MDB_dbi dbi, const MDB_val *key, MDB_val *data, unsigned int flags)
static bool | dbi_del (MDB_txn *txn, MDB_dbi dbi, const MDB_val *key, const MDB_val *data)
static void | cursor_open (MDB_txn *txn, MDB_dbi dbi, MDB_cursor **cursor)
static void | cursor_close (MDB_cursor *cursor) noexcept
static void | cursor_renew (MDB_txn *txn, MDB_cursor *cursor)
static MDB_txn * | cursor_txn (MDB_cursor *cursor) noexcept
static MDB_dbi | cursor_dbi (MDB_cursor *cursor) noexcept
static bool | cursor_get (MDB_cursor *cursor, MDB_val *key, MDB_val *data, MDB_cursor_op op)
static void | cursor_put (MDB_cursor *cursor, MDB_val *key, MDB_val *data, unsigned int flags)
static void | cursor_del (MDB_cursor *cursor, unsigned int flags)
static void | cursor_count (MDB_cursor *cursor, std::size_t &count)

## Detailed Description

<lmdb++.h> - C++11 wrapper for LMDB.

Author
  Arto Bendiken arto@.nosp@m.bend.nosp@m.iken..nosp@m.net

See also
  https://sourceforge.net/projects/lmdbxx/

## Typedef Documentation

## mode

using lmdb::mode = typedef mdb_mode_t

## Function Documentation

## cursor_close()

static void lmdb::cursor_close | ( | MDB_cursor * | cursor | ) |

inline static noexcept

See also
  http://symas.com/mdb/doc/group__mdb.html#gad685f5d73c052715c7bd859cc4c05188

## cursor_count()

static void lmdb::cursor_count | ( | MDB_cursor * | cursor,
|  | std::size_t & | count
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#ga4041fd1e1862c6b7d5f10590b86ffbe2

## cursor_dbi()

static MDB_dbi lmdb::cursor_dbi | ( | MDB_cursor * | cursor | ) |

inline static noexcept

See also
  http://symas.com/mdb/doc/group__mdb.html#ga2f7092cf70ee816fb3d2c3267a732372

## cursor_del()

static void lmdb::cursor_del | ( | MDB_cursor * | cursor,
|  | unsigned int | flags = `0`
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#ga26a52d3efcfd72e5bf6bd6960bf75f95

## cursor_get()

static bool lmdb::cursor_get | ( | MDB_cursor * | cursor,
|  | MDB_val * | key,
|  | MDB_val * | data,
|  | MDB_cursor_op | op
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#ga48df35fb102536b32dfbb801a47b4cb0

## cursor_open()

static void lmdb::cursor_open | ( | MDB_txn * | txn,
|  | MDB_dbi | dbi,
|  | MDB_cursor ** | cursor
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#ga9ff5d7bd42557fd5ee235dc1d62613aa

## cursor_put()

static void lmdb::cursor_put | ( | MDB_cursor * | cursor,
|  | MDB_val * | key,
|  | MDB_val * | data,
|  | unsigned int | flags = `0`
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#ga1f83ccb40011837ff37cc32be01ad91e

## cursor_renew()

static void lmdb::cursor_renew | ( | MDB_txn * | txn,
|  | MDB_cursor * | cursor
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#gac8b57befb68793070c85ea813df481af

## cursor_txn()

static MDB_txn * lmdb::cursor_txn | ( | MDB_cursor * | cursor | ) |

inline static noexcept

See also
  http://symas.com/mdb/doc/group__mdb.html#ga7bf0d458f7f36b5232fcb368ebda79e0

## dbi_close()

static void lmdb::dbi_close | ( | MDB_env * | env,
|  | MDB_dbi | dbi
| ) |  |

inline static noexcept

See also
  http://symas.com/mdb/doc/group__mdb.html#ga52dd98d0c542378370cd6b712ff961b5

## dbi_del()

static bool lmdb::dbi_del | ( | MDB_txn * | txn,
|  | MDB_dbi | dbi,
|  | const MDB_val * | key,
|  | const MDB_val * | data = `nullptr`
| ) |  |

inline static

Return values

  true | if the key/value pair was removed
  false | if the key wasn't found

See also
  http://symas.com/mdb/doc/group__mdb.html#gab8182f9360ea69ac0afd4a4eaab1ddb0

## dbi_drop()

static void lmdb::dbi_drop | ( | MDB_txn * | txn,
|  | MDB_dbi | dbi,
|  | bool | del = `false`
| ) |  |

inline static

See also
  http://symas.com/mdb/doc/group__mdb.html#gab966fab3840fc54a6571dfb32b00f2db

## dbi_flags()

static void lmdb::dbi_flags | ( | MDB_txn * | txn,
|  | MDB_dbi | dbi,
|  | unsigned int * | flags
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#ga95ba4cb721035478a8705e57b91ae4d4

## dbi_get()

static bool lmdb::dbi_get | ( | MDB_txn * | txn,
|  | MDB_dbi | dbi,
|  | const MDB_val * | key,
|  | MDB_val * | data
| ) |  |

inline static

Return values

  true | if the key/value pair was retrieved
  false | if the key wasn't found

See also
  http://symas.com/mdb/doc/group__mdb.html#ga8bf10cd91d3f3a83a34d04ce6b07992d

## dbi_open()

static void lmdb::dbi_open | ( | MDB_txn * | txn,
|  | const char * | name,
|  | unsigned int | flags,
|  | MDB_dbi * | dbi
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#gac08cad5b096925642ca359a6d6f0562a

## dbi_put()

static bool lmdb::dbi_put | ( | MDB_txn * | txn,
|  | MDB_dbi | dbi,
|  | const MDB_val * | key,
|  | MDB_val * | data,
|  | unsigned int | flags = `0`
| ) |  |

inline static

Return values

  true | if the key/value pair was inserted
  false | if the key already existed

See also
  http://symas.com/mdb/doc/group__mdb.html#ga4fa8573d9236d54687c61827ebf8cac0

## dbi_set_compare()

static void lmdb::dbi_set_compare | ( | MDB_txn * | txn,
|  | MDB_dbi | dbi,
|  | MDB_cmp_func * | cmp = `nullptr`
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#ga68e47ffcf72eceec553c72b1784ee0fe

## dbi_set_dupsort()

static void lmdb::dbi_set_dupsort | ( | MDB_txn * | txn,
|  | MDB_dbi | dbi,
|  | MDB_cmp_func * | cmp = `nullptr`
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#gacef4ec3dab0bbd9bc978b73c19c879ae

## dbi_set_relctx()

static void lmdb::dbi_set_relctx | ( | MDB_txn * | txn,
|  | MDB_dbi | dbi,
|  | void * | ctx
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#ga7c34246308cee01724a1839a8f5cc594

## dbi_set_relfunc()

static void lmdb::dbi_set_relfunc | ( | MDB_txn * | txn,
|  | MDB_dbi | dbi,
|  | MDB_rel_func * | rel
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#ga697d82c7afe79f142207ad5adcdebfeb

## dbi_stat()

static void lmdb::dbi_stat | ( | MDB_txn * | txn,
|  | MDB_dbi | dbi,
|  | MDB_stat * | stat
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#gae6c1069febe94299769dbdd032fadef6

## env_close()

static void lmdb::env_close | ( | MDB_env * | env | ) |

inline static noexcept

See also
  http://symas.com/mdb/doc/group__mdb.html#ga4366c43ada8874588b6a62fbda2d1e95

## env_copy()

static void lmdb::env_copy | ( | MDB_env * | env,
|  | const char * | path,
|  | unsigned int | flags = `0`
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#ga3bf50d7793b36aaddf6b481a44e24244
  http://symas.com/mdb/doc/group__mdb.html#ga5d51d6130325f7353db0955dbedbc378

## env_copy_fd()

static void lmdb::env_copy_fd | ( | MDB_env * | env,
|  | mdb_filehandle_t | fd,
|  | unsigned int | flags = `0`
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#ga5040d0de1f14000fa01fc0b522ff1f86
  http://symas.com/mdb/doc/group__mdb.html#ga470b0bcc64ac417de5de5930f20b1a28

## env_create()

static void lmdb::env_create | ( | MDB_env ** | env | ) |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#gaad6be3d8dcd4ea01f8df436f41d158d4

## env_get_fd()

static void lmdb::env_get_fd | ( | MDB_env * | env,
|  | mdb_filehandle_t * | fd
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#gaf1570e7c0e5a5d860fef1032cec7d5f2

## env_get_flags()

static void lmdb::env_get_flags | ( | MDB_env * | env,
|  | unsigned int * | flags
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#ga2733aefc6f50beb49dd0c6eb19b067d9

## env_get_max_keysize()

static unsigned int lmdb::env_get_max_keysize | ( | MDB_env * | env | ) |

inline static

See also
  http://symas.com/mdb/doc/group__mdb.html#gaaf0be004f33828bf2fb09d77eb3cef94

## env_get_max_readers()

static void lmdb::env_get_max_readers | ( | MDB_env * | env,
|  | unsigned int * | count
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#ga70e143cf11760d869f754c9c9956e6cc

## env_get_path()

static void lmdb::env_get_path | ( | MDB_env * | env,
|  | const char ** | path
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#gac699fdd8c4f8013577cb933fb6a757fe

## env_get_userctx()

static void * lmdb::env_get_userctx | ( | MDB_env * | env | ) |

inline static

Since
  0.9.11 (2014/01/15)

See also
  http://symas.com/mdb/doc/group__mdb.html#ga45df6a4fb150cda2316b5ae224ba52f1

## env_info()

static void lmdb::env_info | ( | MDB_env * | env,
|  | MDB_envinfo * | stat
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#ga18769362c7e7d6cf91889a028a5c5947

## env_open()

static void lmdb::env_open | ( | MDB_env * | env,
|  | const char * | path,
|  | unsigned int | flags,
|  | mode | mode
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#ga32a193c6bf4d7d5c5d579e71f22e9340

## env_set_flags()

static void lmdb::env_set_flags | ( | MDB_env * | env,
|  | unsigned int | flags,
|  | bool | onoff = `true`
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#ga83f66cf02bfd42119451e9468dc58445

## env_set_mapsize()

static void lmdb::env_set_mapsize | ( | MDB_env * | env,
|  | std::size_t | size
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#gaa2506ec8dab3d969b0e609cd82e619e5

## env_set_max_dbs()

static void lmdb::env_set_max_dbs | ( | MDB_env * | env,
|  | MDB_dbi | count
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#gaa2fc2f1f37cb1115e733b62cab2fcdbc

## env_set_max_readers()

static void lmdb::env_set_max_readers | ( | MDB_env * | env,
|  | unsigned int | count
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#gae687966c24b790630be2a41573fe40e2

## env_set_userctx()

static void lmdb::env_set_userctx | ( | MDB_env * | env,
|  | void * | ctx
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

Since
  0.9.11 (2014/01/15)

See also
  http://symas.com/mdb/doc/group__mdb.html#gaf2fe09eb9c96eeb915a76bf713eecc46

## env_stat()

static void lmdb::env_stat | ( | MDB_env * | env,
|  | MDB_stat * | stat
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#gaf881dca452050efbd434cd16e4bae255

## env_sync()

static void lmdb::env_sync | ( | MDB_env * | env,
|  | bool | force = `true`
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#ga85e61f05aa68b520cc6c3b981dba5037

## txn_abort()

static void lmdb::txn_abort | ( | MDB_txn * | txn | ) |

inline static noexcept

See also
  http://symas.com/mdb/doc/group__mdb.html#ga73a5938ae4c3239ee11efa07eb22b882

## txn_begin()

static void lmdb::txn_begin | ( | MDB_env * | env,
|  | MDB_txn * | parent,
|  | unsigned int | flags,
|  | MDB_txn ** | txn
| ) |  |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#gad7ea55da06b77513609efebd44b26920

## txn_commit()

static void lmdb::txn_commit | ( | MDB_txn * | txn | ) |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#ga846fbd6f46105617ac9f4d76476f6597

## txn_env()

static MDB_env * lmdb::txn_env | ( | MDB_txn * | txn | ) |

inline static noexcept

See also
  http://symas.com/mdb/doc/group__mdb.html#gaeb17735b8aaa2938a78a45cab85c06a0

## txn_renew()

static void lmdb::txn_renew | ( | MDB_txn * | txn | ) |

inline static

Exceptions

  lmdb::error | on failure

See also
  http://symas.com/mdb/doc/group__mdb.html#ga6c6f917959517ede1c504cf7c720ce6d

## txn_reset()

static void lmdb::txn_reset | ( | MDB_txn * | txn | ) |

inline static noexcept

See also
  http://symas.com/mdb/doc/group__mdb.html#ga02b06706f8a66249769503c4e88c56cd