A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/lmdb_09_09_8h_source.html below:

NCBI C++ ToolKit: include/util/lmdbxx/lmdb++.h Source File

24 #error "<lmdb++.h> requires a C++ compiler" 27 #if __cplusplus < 201103L 28 #if !defined(_MSC_VER) || _MSC_VER < 1800 29 #error "<lmdb++.h> requires a C++11 compiler (CXXFLAGS='-std=c++11')" 45 #include <type_traits> 47 #if defined(_MSC_VER) && _MSC_VER < 1900 52 # define LMDB_NOEXCEPT 53 # define LMDB_CONSTEXPR const 54 # define LMDB_SNPRINTF _snprintf 56 # define LMDB_NOEXCEPT noexcept 57 # define LMDB_CONSTEXPR constexpr 58 # define LMDB_SNPRINTF snprintf 73  class

key_exist_error;

74  class

not_found_error;

75  class

corrupted_error;

77  class

version_mismatch_error;

93  mutable char buffer

[1024];

103  static inline void raise

(

const char

*

origin

,

int

rc);

132  static

thread_local

char buffer

[1024];

187  using

runtime_error::runtime_error;

201  using

runtime_error::runtime_error;

257  using

runtime_error::runtime_error;

272  using

runtime_error::runtime_error;

311 #if MDB_VERSION_FULL >= MDB_VERINT(0, 9, 14) 331 #if MDB_VERSION_FULL >= MDB_VERINT(0, 9, 11) 358  const char

*

const

path,

359  const unsigned int flags

,

375  const char

*

const

path,

376  const unsigned int flags

= 0) {

379  const char

*

const

path) {

396  const unsigned int flags

= 0) {

439  const bool

force =

true

) {

460  const unsigned int flags

,

461  const bool

onoff =

true

) {

474  unsigned int

*

const flags

) {

487  const char

** path) {

513  const

std::size_t

size

) {

526  const unsigned int count

) {

539  unsigned int

*

const count

) {

562 static inline unsigned int 568  return static_cast<unsigned int>

(rc);

571 #if MDB_VERSION_FULL >= MDB_VERINT(0, 9, 11) 587 #if MDB_VERSION_FULL >= MDB_VERINT(0, 9, 11) 621  const unsigned int flags

,

641 static inline

std::size_t

714  const char

*

const

name,

715  const unsigned int flags

,

744  unsigned int

*

const flags

) {

766  const bool

del =

false

) {

856  const unsigned int flags

= 0) {

971  const unsigned int flags

= 0) {

984  const unsigned int flags

= 0) {

997

std::size_t&

count

) {

1042  template

<

typename

T>

1044

:

val

{&

t

,

sizeof

(

T

)} {}

1105  return size

() == 0;

1118  template

<

typename

T>

1126  template

<

typename

T>

1135  return reinterpret_cast<char

*

>

(

_val

.

mv_data

);

1142  return reinterpret_cast<char

*

>

(

_val

.

mv_data

);

1148  template

<

typename

T>

1152  _val

.

mv_data

=

const_cast<void

*

>

(

reinterpret_cast<const void

*

>

(

data

));

1159  template

<

typename

T>

1162  _val

.

mv_data

=

const_cast<void

*

>

(

reinterpret_cast<const void

*

>

(&

data

));

1191  template

<

typename

T>

1193  t

= *data<const T>();

1205 #if !(defined(__COVERITY__) || defined(_MSC_VER) || defined(__INTEL_COMPILER)) 1208

static_assert(

sizeof

(

lmdb::val

) ==

sizeof

(

MDB_val

),

"sizeof(lmdb::val) != sizeof(MDB_val)"

);

1275  if

(

this

!= &other) {

1285  try

{

close

(); }

catch

(...) {}

1308  void sync

(

const bool

force =

true

) {

1346  const bool

onoff =

true

) {

1408  MDB_txn

*

const

parent =

nullptr

,

1437  if

(

this

!= &other) {

1448  try

{

abort

(); }

catch

(...) {}

1543  const char

*

const

name =

nullptr

,

1569  if

(

this

!= &other) {

1648  const bool del

=

false

) {

1686  template

<

typename

K>

1688  const

K&

key

)

const

{

1702  template

<

typename

K,

typename

V>

1722  template

<

typename

V>

1724  const char

*

const key

,

1758  template

<

typename

K>

1776  template

<

typename

K,

typename

V>

1795  template

<

typename

V>

1797  const char

*

const key

,

1815  const char

*

const key

,

1816  const char

*

const val

,

1842  template

<

typename

K>

1907  if

(

this

!= &other) {

1917  try

{

close

(); }

catch

(...) {}

1980  return get

(

key

,

nullptr

, op);

1992  return get

(

key

,

nullptr

, op);

2031  template

<

typename

K,

typename

V>

2036  const bool

found =

get

(k, v, op);

2051  template

<

typename

K>

2055  return get

(k,

nullptr

, op);

2061 #undef LMDB_NOEXCEPT 2062 #undef LMDB_CONSTEXPR 2063 #undef LMDB_SNPRINTF

Exception class for `MDB_BAD_DBI` errors.

Exception class for `MDB_CORRUPTED` errors.

Resource class for `MDB_cursor*` handles.

bool get(lmdb::val &key, const MDB_cursor_op op)

Retrieves a key from the database.

MDB_cursor * handle() const noexcept

Returns the underlying `MDB_cursor*` handle.

bool get(K &key, V &val, const MDB_cursor_op op)

Retrieves a key/value pair from the database.

static constexpr unsigned int default_flags

MDB_txn * txn() const noexcept

Returns the cursor's transaction handle.

bool get(lmdb::val &key, lmdb::val &val, const MDB_cursor_op op)

Retrieves a key/value pair from the database.

void close() noexcept

Closes this cursor.

~cursor() noexcept

Destructor.

bool get(MDB_val *const key, const MDB_cursor_op op)

Retrieves a key from the database.

bool find(const K &key, const MDB_cursor_op op=MDB_SET)

Positions this cursor at the given key.

cursor(cursor &&other) noexcept

Move constructor.

MDB_dbi dbi() const noexcept

Returns the cursor's database handle.

static cursor open(MDB_txn *const txn, const MDB_dbi dbi)

Creates an LMDB cursor.

cursor(MDB_cursor *const handle) noexcept

Constructor.

bool get(MDB_val *const key, MDB_val *const val, const MDB_cursor_op op)

Retrieves a key/value pair from the database.

cursor & operator=(cursor &&other) noexcept

Move assignment operator.

void renew(MDB_txn *const txn)

Renews this cursor.

Resource class for `MDB_dbi` handles.

std::size_t size(MDB_txn *const txn) const

Returns the number of records in this database.

static constexpr unsigned int default_put_flags

bool put(MDB_txn *const txn, const K &key, const V &val, const unsigned int flags=default_put_flags)

Stores a key/value pair into this database.

dbi(const MDB_dbi handle) noexcept

Constructor.

bool del(MDB_txn *const txn, const val &key)

Removes a key/value pair from this database.

dbi & operator=(dbi &&other) noexcept

Move assignment operator.

~dbi() noexcept

Destructor.

void close(MDB_env *const env)

Closes DB handle.

bool get(MDB_txn *const txn, const val &key, val &data) const

Retrieves a key/value pair from this database.

MDB_stat stat(MDB_txn *const txn) const

Returns statistics for this database.

bool put(MDB_txn *const txn, const char *const key, const V &val, const unsigned int flags=default_put_flags)

Stores a key/value pair into this database.

unsigned int flags(MDB_txn *const txn) const

Retrieves the flags for this database handle.

bool del(MDB_txn *const txn, const K &key)

Removes a key/value pair from this database.

static dbi open(MDB_txn *const txn, const char *const name=nullptr, const unsigned int flags=default_flags)

Opens a database handle.

static constexpr unsigned int default_flags

dbi & set_compare(MDB_txn *const txn, MDB_cmp_func *const cmp=nullptr)

Sets a custom key comparison function for this database.

bool get(MDB_txn *const txn, const K &key, V &val) const

Retrieves a key/value pair from this database.

bool put(MDB_txn *const txn, const val &key, const val &data, const unsigned int flags=default_put_flags)

Stores a key/value pair into this database.

void drop(MDB_txn *const txn, const bool del=false)

bool put(MDB_txn *const txn, const char *const key, const char *const val, const unsigned int flags=default_put_flags)

Stores a key/value pair into this database.

bool get(MDB_txn *const txn, const char *const key, V &val) const

Retrieves a key/value pair from this database.

dbi(dbi &&other) noexcept

Move constructor.

bool get(MDB_txn *const txn, const K &key) const

Retrieves a key from this database.

MDB_dbi handle() const noexcept

Returns the underlying `MDB_dbi` handle.

bool put(MDB_txn *const txn, const K &key, const unsigned int flags=default_put_flags)

Stores a key into this database.

Resource class for `MDB_env*` handles.

void close() noexcept

Closes this environment, releasing the memory map.

static constexpr mode default_mode

env & set_flags(const unsigned int flags, const bool onoff=true)

~env() noexcept

Destructor.

MDB_env * handle() const noexcept

Returns the underlying `MDB_env*` handle.

env(MDB_env *const handle) noexcept

Constructor.

env(env &&other) noexcept

Move constructor.

env & operator=(env &&other) noexcept

Move assignment operator.

env & open(const char *const path, const unsigned int flags=default_flags, const mode mode=default_mode)

Opens this environment.

void sync(const bool force=true)

Flushes data buffers to disk.

static constexpr unsigned int default_flags

static env create(const unsigned int flags=default_flags)

Creates a new LMDB environment.

env & set_max_readers(const unsigned int count)

env & set_max_dbs(const MDB_dbi count)

env & set_mapsize(const std::size_t size)

Base class for LMDB exception conditions.

error(const char *const origin, const int rc) noexcept

Constructor.

virtual const char * what() const noexcept

Returns the underlying LMDB error code.

int code() const noexcept

Returns the underlying LMDB error code.

static void raise(const char *origin, int rc)

Throws an error based on the given LMDB return code.

const char * origin() const noexcept

Returns the origin of the LMDB error.

Base class for fatal error conditions.

Exception class for `MDB_KEYEXIST` errors.

Base class for logic error conditions.

Exception class for `MDB_MAP_FULL` errors.

Exception class for `MDB_NOTFOUND` errors.

Exception class for `MDB_PANIC` errors.

Base class for runtime error conditions.

Resource class for `MDB_txn*` handles.

void commit()

Commits this transaction.

MDB_env * env() const noexcept

Returns the transaction's `MDB_env*` handle.

txn & operator=(txn &&other) noexcept

Move assignment operator.

void abort() noexcept

Aborts this transaction.

void reset() noexcept

Resets this read-only transaction.

static constexpr unsigned int default_flags

~txn() noexcept

Destructor.

void renew()

Renews this read-only transaction.

txn(txn &&other) noexcept

Move constructor.

txn(MDB_txn *const handle) noexcept

Constructor.

static txn begin(MDB_env *const env, MDB_txn *const parent=nullptr, const unsigned int flags=default_flags)

Creates a new LMDB transaction.

MDB_txn * handle() const noexcept

Returns the underlying `MDB_txn*` handle.

Wrapper class for `MDB_val` structures.

val & assign(const T &data) noexcept

Assigns the value.

val(const char *const data) noexcept

Constructor.

val & assign(const T *const data, const std::size_t size) noexcept

Assigns the value.

val(const T &t) noexcept

Template Constructor.

val(const void *const data, const std::size_t size) noexcept

Constructor.

const T * data() const noexcept

Returns a pointer to the data.

val & assign(const std::string::const_iterator &data, const std::size_t len) noexcept

Assigns the value.

bool empty() const noexcept

Determines whether this value is empty.

const char * data() const noexcept

Returns a pointer to the data.

void assign_to(std::string &str)

Convert value to string.

void assign_to(T &t)

Convert value to T.

val(val &&other) noexcept=default

Move constructor.

T * data() noexcept

Returns a pointer to the data.

val() noexcept=default

Default constructor.

val(const std::string::const_iterator &data, std::size_t len) noexcept

Constructor.

char * data() noexcept

Returns a pointer to the data.

val & assign(const char *const data) noexcept

Assigns the value.

~val() noexcept=default

Destructor.

std::size_t size() const noexcept

Returns the size of the data.

val(const val &other) noexcept=default

Copy constructor.

val & operator=(val &&other) noexcept=default

Move assignment operator.

val & assign(const std::string &data) noexcept

Assigns the value.

Exception class for `MDB_VERSION_MISMATCH` errors.

static const char * str(char *buf, int n)

static void fatal_error(const char *msg)

void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)

#define MDB_VERINT(a, b, c)

Combine args a,b,c into a single integer for easy version comparisons.

#define MDB_VERSION_FULL

The full library version as a single integer.

#define MDB_KEYEXIST

key/data pair already exists

#define MDB_MAP_FULL

Environment mapsize reached.

#define MDB_VERSION_MISMATCH

Environment version mismatch.

#define MDB_BAD_DBI

The specified DBI was changed unexpectedly.

#define MDB_NOTFOUND

key/data pair not found (EOF)

#define MDB_SUCCESS

Successful result.

#define MDB_PANIC

Update of meta page failed or environment had fatal error.

#define MDB_CORRUPTED

Located page was wrong type.

void mdb_txn_reset(MDB_txn *txn)

Reset a read-only transaction.

int mdb_env_info(MDB_env *env, MDB_envinfo *stat)

Return information about the LMDB environment.

int mdb_cursor_put(MDB_cursor *cursor, MDB_val *key, MDB_val *data, unsigned int flags)

Store by cursor.

int mdb_cursor_del(MDB_cursor *cursor, unsigned int flags)

Delete current key/data pair.

int mdb_env_get_flags(MDB_env *env, unsigned int *flags)

Get environment flags.

MDB_dbi mdb_cursor_dbi(MDB_cursor *cursor)

Return the cursor's database handle.

int mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mdb_mode_t mode)

Open an environment handle.

int mdb_env_copy2(MDB_env *env, const char *path, unsigned int flags)

Copy an LMDB environment to the specified path, with options.

int mdb_cursor_count(MDB_cursor *cursor, size_t *countp)

Return count of duplicates for current key.

void mdb_env_close(MDB_env *env)

Close the environment and release the memory map.

int mdb_env_copyfd(MDB_env *env, mdb_filehandle_t fd)

Copy an LMDB environment to the specified file descriptor.

int mdb_cursor_get(MDB_cursor *cursor, MDB_val *key, MDB_val *data, MDB_cursor_op op)

Retrieve by cursor.

int mdb_put(MDB_txn *txn, MDB_dbi dbi, MDB_val *key, MDB_val *data, unsigned int flags)

Store items into a database.

int mdb_env_copyfd2(MDB_env *env, mdb_filehandle_t fd, unsigned int flags)

Copy an LMDB environment to the specified file descriptor, with options.

void mdb_dbi_close(MDB_env *env, MDB_dbi dbi)

Close a database handle.

int mdb_env_copy(MDB_env *env, const char *path)

Copy an LMDB environment to the specified path.

int mdb_set_compare(MDB_txn *txn, MDB_dbi dbi, MDB_cmp_func *cmp)

Set a custom key comparison function for a database.

int mdb_set_relfunc(MDB_txn *txn, MDB_dbi dbi, MDB_rel_func *rel)

Set a relocation function for a MDB_FIXEDMAP database.

int mdb_txn_renew(MDB_txn *txn)

Renew a read-only transaction.

void * mdb_env_get_userctx(MDB_env *env)

Get the application information associated with the MDB_env.

int mdb_env_get_maxreaders(MDB_env *env, unsigned int *readers)

Get the maximum number of threads/reader slots for the environment.

void mdb_txn_abort(MDB_txn *txn)

Abandon all the operations of the transaction instead of saving them.

int mdb_set_relctx(MDB_txn *txn, MDB_dbi dbi, void *ctx)

Set a context pointer for a MDB_FIXEDMAP database's relocation function.

int mdb_env_set_flags(MDB_env *env, unsigned int flags, int onoff)

Set environment flags.

int mdb_txn_commit(MDB_txn *txn)

Commit all the operations of a transaction into the database.

int mdb_env_sync(MDB_env *env, int force)

Flush the data buffers to disk.

int mdb_get(MDB_txn *txn, MDB_dbi dbi, MDB_val *key, MDB_val *data)

Get items from a database.

int mdb_dbi_flags(MDB_txn *txn, MDB_dbi dbi, unsigned int *flags)

Retrieve the DB flags for a database handle.

char * mdb_strerror(int err)

Return a string describing a given error code.

int mdb_cursor_open(MDB_txn *txn, MDB_dbi dbi, MDB_cursor **cursor)

Create a cursor handle.

int mdb_env_set_mapsize(MDB_env *env, size_t size)

Set the size of the memory map to use for this environment.

int mdb_env_set_maxdbs(MDB_env *env, MDB_dbi dbs)

Set the maximum number of named databases for the environment.

int mdb_env_create(MDB_env **env)

Create an LMDB environment handle.

int mdb_env_get_maxkeysize(MDB_env *env)

Get the maximum size of keys and MDB_DUPSORT data we can write.

int mdb_del(MDB_txn *txn, MDB_dbi dbi, MDB_val *key, MDB_val *data)

Delete items from a database.

int mdb_drop(MDB_txn *txn, MDB_dbi dbi, int del)

Empty or delete+close a database.

int mdb_dbi_open(MDB_txn *txn, const char *name, unsigned int flags, MDB_dbi *dbi)

Open a database in the environment.

int mdb_env_get_path(MDB_env *env, const char **path)

Return the path that was used in mdb_env_open().

int mdb_cursor_renew(MDB_txn *txn, MDB_cursor *cursor)

Renew a cursor handle.

int mdb_set_dupsort(MDB_txn *txn, MDB_dbi dbi, MDB_cmp_func *cmp)

Set a custom data comparison function for a MDB_DUPSORT database.

void mdb_cursor_close(MDB_cursor *cursor)

Close a cursor handle.

int mdb_txn_begin(MDB_env *env, MDB_txn *parent, unsigned int flags, MDB_txn **txn)

Create a transaction for use with the environment.

size_t mdb_txn_id(MDB_txn *txn)

Return the transaction's ID.

MDB_cursor_op

Cursor Get operations.

int mdb_env_set_maxreaders(MDB_env *env, unsigned int readers)

Set the maximum number of threads/reader slots for the environment.

int mdb_stat(MDB_txn *txn, MDB_dbi dbi, MDB_stat *stat)

Retrieve statistics for a database.

MDB_txn * mdb_cursor_txn(MDB_cursor *cursor)

Return the cursor's transaction handle.

int mdb_env_get_fd(MDB_env *env, mdb_filehandle_t *fd)

Return the filedescriptor for the given environment.

int mdb_env_set_userctx(MDB_env *env, void *ctx)

Set application information associated with the MDB_env.

int mdb_env_stat(MDB_env *env, MDB_stat *stat)

Return statistics about the LMDB environment.

MDB_env * mdb_txn_env(MDB_txn *txn)

Returns the transaction's MDB_env.

@ MDB_SET

Position at specified key.

size_t ms_entries

Number of data items.

size_t mv_size

size of the data item

void * mv_data

address of the data item

void() MDB_rel_func(MDB_val *item, void *oldptr, void *newptr, void *relctx)

A callback function used to relocate a position-dependent data item in a fixed-address database.

int() MDB_cmp_func(const MDB_val *a, const MDB_val *b)

A callback function used to compare two keys in a database.

unsigned int MDB_dbi

A handle for an individual database in the DB environment.

#define LMDB_NOEXCEPT

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

static void env_info(MDB_env *env, MDB_envinfo *stat)

static void * env_get_userctx(MDB_env *env)

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

static void cursor_renew(MDB_txn *txn, MDB_cursor *cursor)

static void env_copy_fd(MDB_env *env, mdb_filehandle_t fd, unsigned int flags)

static void txn_commit(MDB_txn *txn)

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

static MDB_txn * cursor_txn(MDB_cursor *cursor) noexcept

static void dbi_drop(MDB_txn *txn, MDB_dbi dbi, bool del)

static bool dbi_put(MDB_txn *txn, MDB_dbi dbi, const MDB_val *key, const MDB_val *data, unsigned int flags)

static void env_create(MDB_env **env)

static unsigned int env_get_max_keysize(MDB_env *env)

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

static void cursor_put(MDB_cursor *cursor, MDB_val *key, MDB_val *data, unsigned int flags)

static void env_get_fd(MDB_env *env, mdb_filehandle_t *fd)

static void cursor_del(MDB_cursor *cursor, unsigned int flags)

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

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

static void dbi_set_compare(MDB_txn *txn, MDB_dbi dbi, MDB_cmp_func *cmp)

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

static MDB_env * txn_env(MDB_txn *txn) noexcept

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

static void env_set_max_dbs(MDB_env *env, MDB_dbi count)

static void env_close(MDB_env *env) noexcept

static void env_set_flags(MDB_env *env, unsigned int flags, bool onoff)

static void txn_renew(MDB_txn *txn)

static void cursor_close(MDB_cursor *cursor) noexcept

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

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

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

static MDB_dbi cursor_dbi(MDB_cursor *cursor) noexcept

static void txn_abort(MDB_txn *txn) noexcept

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

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

static bool dbi_del(MDB_txn *txn, MDB_dbi dbi, const MDB_val *key, const MDB_val *data)

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

static void env_copy(MDB_env *env, const char *path, unsigned int flags)

static void txn_reset(MDB_txn *txn) noexcept

static void env_set_userctx(MDB_env *env, void *ctx)

static void dbi_close(MDB_env *env, MDB_dbi dbi) noexcept

static void env_stat(MDB_env *env, MDB_stat *stat)

static void env_sync(MDB_env *env, bool force)

static void dbi_set_dupsort(MDB_txn *txn, MDB_dbi dbi, MDB_cmp_func *cmp)

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

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

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

const struct ncbi::grid::netcache::search::fields::SIZE size

const struct ncbi::grid::netcache::search::fields::KEY key

const GenericPointer< typename T::ValueType > T2 value

static const GLdouble origin[]

int mdb_filehandle_t

An abstraction for a file handle.

mode_t mdb_mode_t

Unix permissions for creating files, or dummy definition for Windows.

Cursors are used for all DB operations.

The database environment.

Information about the environment.

Statistics for a database in the environment.

Generic structure used for passing keys and data in and out of the database.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4