![]() |
Master Core
v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
|
RAII class that provides access to a Berkeley database. More...
#include <db.h>
Public Member Functions | |
void | Flush () |
void | Close () |
bool | TxnBegin () |
bool | TxnCommit () |
bool | TxnAbort () |
bool | ReadVersion (int &nVersion) |
bool | WriteVersion (int nVersion) |
Static Public Member Functions | |
static bool | Rewrite (const std::string &strFile, const char *pszSkip=NULL) |
Protected Member Functions | |
CDB (const char *pszFile, const char *pszMode="r+") | |
~CDB () | |
template<typename K , typename T > | |
bool | Read (const K &key, T &value) |
template<typename K , typename T > | |
bool | Write (const K &key, const T &value, bool fOverwrite=true) |
template<typename K > | |
bool | Erase (const K &key) |
template<typename K > | |
bool | Exists (const K &key) |
Dbc * | GetCursor () |
int | ReadAtCursor (Dbc *pcursor, CDataStream &ssKey, CDataStream &ssValue, unsigned int fFlags=DB_NEXT) |
Protected Attributes | |
Db * | pdb |
std::string | strFile |
DbTxn * | activeTxn |
bool | fReadOnly |
Private Member Functions | |
CDB (const CDB &) | |
void | operator= (const CDB &) |
|
explicitprotected |
Definition at line 224 of file db.cpp.
References CLIENT_VERSION, CDBEnv::cs_db, CDBEnv::dbenv, Exists(), fReadOnly, GetDataDir(), CDBEnv::IsMock(), LOCK, CDBEnv::mapDb, CDBEnv::mapFileUseCount, CDBEnv::Open(), pdb, strFile, strprintf, and WriteVersion().
|
inlineprotected |
|
private |
void CDB::Close | ( | ) |
Definition at line 300 of file db.cpp.
References activeTxn, CDBEnv::cs_db, Flush(), LOCK, CDBEnv::mapFileUseCount, pdb, and strFile.
Referenced by ~CDB().
|
inlineprotected |
Definition at line 173 of file db.h.
References CLIENT_VERSION, CDataStream::reserve(), SER_DISK, and CDataStream::size().
|
inlineprotected |
Definition at line 195 of file db.h.
References CLIENT_VERSION, CDataStream::reserve(), SER_DISK, and CDataStream::size().
Referenced by CDB().
void CDB::Flush | ( | ) |
|
private |
|
inlineprotected |
Definition at line 109 of file db.h.
References CLIENT_VERSION, CDataStream::reserve(), SER_DISK, and CDataStream::size().
Referenced by ReadVersion().
|
inlineprotected |
Definition at line 225 of file db.h.
References CDataStream::clear(), SER_DISK, CDataStream::SetType(), CDataStream::size(), and CDataStream::write().
|
inline |
|
static |
Definition at line 341 of file db.cpp.
References CDBEnv::CheckpointLSN(), CDataStream::clear(), CLIENT_VERSION, CDBEnv::CloseDb(), CDBEnv::cs_db, CDBEnv::dbenv, LOCK, LogPrintf, CDBEnv::mapFileUseCount, MilliSleep(), SER_DISK, CDataStream::size(), and strFile.
Referenced by CWallet::EncryptWallet(), CWallet::LoadWallet(), and CWallet::ZapWalletTx().
|
inline |
Definition at line 265 of file db.h.
References CDBEnv::TxnBegin().
Referenced by movecmd().
|
inline |
|
inlineprotected |
Definition at line 144 of file db.h.
References CLIENT_VERSION, CDataStream::reserve(), SER_DISK, and CDataStream::size().
Referenced by WriteVersion().
|
inline |
|
protected |
|
protected |