![]() |
BSHA3
0.17.99
P2P Blockchain, based on Bitcoin
|
An instance of this class represents one database. More...
#include <db.h>
Public Member Functions | |
BerkeleyDatabase () | |
Create dummy DB handle. More... | |
BerkeleyDatabase (const fs::path &wallet_path, bool mock=false) | |
Create DB handle to real database. More... | |
bool | Rewrite (const char *pszSkip=nullptr) |
Rewrite the entire database on disk, with the exception of key pszSkip if non-zero. More... | |
bool | Backup (const std::string &strDest) |
Back up the entire database to a file. More... | |
void | Flush (bool shutdown) |
Make sure all changes are flushed to disk. More... | |
void | IncrementUpdateCounter () |
void | ReloadDbEnv () |
Static Public Member Functions | |
static std::unique_ptr< BerkeleyDatabase > | Create (const fs::path &path) |
Return object for accessing database at specified path. More... | |
static std::unique_ptr< BerkeleyDatabase > | CreateDummy () |
Return object for accessing dummy database with no read/write capabilities. More... | |
static std::unique_ptr< BerkeleyDatabase > | CreateMock () |
Return object for accessing temporary in-memory database. More... | |
Public Attributes | |
std::atomic< unsigned int > | nUpdateCounter |
unsigned int | nLastSeen |
unsigned int | nLastFlushed |
int64_t | nLastWalletUpdate |
Private Member Functions | |
bool | IsDummy () |
Return whether this database handle is a dummy for testing. More... | |
Private Attributes | |
BerkeleyEnvironment * | env |
BerkeleyDB specific. More... | |
std::string | strFile |
Friends | |
class | BerkeleyBatch |
An instance of this class represents one database.
For BerkeleyDB this is just a (env, strFile) tuple.
|
inline |
|
inline |
bool BerkeleyDatabase::Backup | ( | const std::string & | strDest | ) |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
void BerkeleyDatabase::Flush | ( | bool | shutdown | ) |
void BerkeleyDatabase::IncrementUpdateCounter | ( | ) |
|
inlineprivate |
void BerkeleyDatabase::ReloadDbEnv | ( | ) |
bool BerkeleyDatabase::Rewrite | ( | const char * | pszSkip = nullptr | ) |
|
friend |
|
private |