Db |
#include <db_cxx.h>class Db { public: Db(DbEnv *dbenv, u_int32_t flags); ~Db();
DB *Db::get_DB(); const DB *Db::get_const_DB() const; static Db *Db::get_Db(DB *db); static const Db *Db::get_const_Db(const DB *db); ... };
This manual page describes the specific details of the Db class, which is the center of access method activity.
If no dbenv value is specified, the database is standalone; that is, it is not part of any Berkeley DB environment.
If a dbenv value is specified, the database is created within the specified Berkeley DB environment. The database access methods automatically make calls to the other subsystems in Berkeley DB based on the enclosing environment. For example, if the environment has been configured to use locking, the access methods will automatically acquire the correct locks when reading and writing pages of the database.
The flags value must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
If dbenv is not null, this flag is ignored, and the error behavior of the specified environment is used instead.
Each Db object has an associated DB struct, which is used by the underlying implementation of Berkeley DB and its C-language API. The Db::get_DB method returns a pointer to this struct. Given a const Db object, Db::get_const_DB returns a const pointer to the same struct.
Given a DB struct, the Db::get_Db method returns the corresponding Db object, if there is one. If the DB object was not associated with a Db (that is, it was not returned from a call to Db::get_DB), then the result of Db::get_Db is undefined. Given a const DB struct, Db::get_const_Db returns the associated const Db object, if there is one.
These methods may be useful for Berkeley DB applications including both C and C++ language software. It should not be necessary to use these calls in a purely C++ application.