Bitcoin Core  0.20.99
P2P Digital Currency
Public Member Functions | Public Attributes | Private Attributes | List of all members
BerkeleyEnvironment Class Reference

#include <bdb.h>

Public Member Functions

 BerkeleyEnvironment (const fs::path &env_directory)
 
 BerkeleyEnvironment ()
 Construct an in-memory mock Berkeley environment for testing. More...
 
 ~BerkeleyEnvironment ()
 
void Reset ()
 
bool IsMock () const
 
bool IsInitialized () const
 
bool IsDatabaseLoaded (const std::string &db_filename) const
 
fs::path Directory () const
 
bool Verify (const std::string &strFile)
 
bool Open (bool retry)
 
void Close ()
 
void Flush (bool fShutdown)
 
void CheckpointLSN (const std::string &strFile)
 
void CloseDb (const std::string &strFile)
 
void ReloadDbEnv ()
 
DbTxn * TxnBegin (int flags=DB_TXN_WRITE_NOSYNC)
 

Public Attributes

std::unique_ptr< DbEnv > dbenv
 
std::map< std::string, int > mapFileUseCount
 
std::map< std::string, std::reference_wrapper< BerkeleyDatabase > > m_databases
 
std::unordered_map< std::string, WalletDatabaseFileIdm_fileids
 
std::condition_variable_any m_db_in_use
 

Private Attributes

bool fDbEnvInit
 
bool fMockDb
 
std::string strPath
 

Detailed Description

Definition at line 44 of file bdb.h.

Constructor & Destructor Documentation

◆ BerkeleyEnvironment() [1/2]

BerkeleyEnvironment::BerkeleyEnvironment ( const fs::path &  env_directory)

Definition at line 130 of file bdb.cpp.

Here is the call graph for this function:

◆ BerkeleyEnvironment() [2/2]

BerkeleyEnvironment::BerkeleyEnvironment ( )

Construct an in-memory mock Berkeley environment for testing.

Definition at line 216 of file bdb.cpp.

Here is the call graph for this function:

◆ ~BerkeleyEnvironment()

BerkeleyEnvironment::~BerkeleyEnvironment ( )

Definition at line 135 of file bdb.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ CheckpointLSN()

void BerkeleyEnvironment::CheckpointLSN ( const std::string &  strFile)

Definition at line 329 of file bdb.cpp.

Here is the caller graph for this function:

◆ Close()

void BerkeleyEnvironment::Close ( )

Definition at line 92 of file bdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CloseDb()

void BerkeleyEnvironment::CloseDb ( const std::string &  strFile)

Definition at line 457 of file bdb.cpp.

Here is the caller graph for this function:

◆ Directory()

fs::path BerkeleyEnvironment::Directory ( ) const
inline

Definition at line 68 of file bdb.h.

Here is the caller graph for this function:

◆ Flush()

void BerkeleyEnvironment::Flush ( bool  fShutdown)

Definition at line 587 of file bdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsDatabaseLoaded()

bool BerkeleyEnvironment::IsDatabaseLoaded ( const std::string &  db_filename) const
inline

Definition at line 67 of file bdb.h.

Here is the caller graph for this function:

◆ IsInitialized()

bool BerkeleyEnvironment::IsInitialized ( ) const
inline

Definition at line 66 of file bdb.h.

◆ IsMock()

bool BerkeleyEnvironment::IsMock ( ) const
inline

Definition at line 65 of file bdb.h.

Here is the caller graph for this function:

◆ Open()

bool BerkeleyEnvironment::Open ( bool  retry)

debug

Definition at line 142 of file bdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReloadDbEnv()

void BerkeleyEnvironment::ReloadDbEnv ( )

Definition at line 472 of file bdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Reset()

void BerkeleyEnvironment::Reset ( )

Definition at line 123 of file bdb.cpp.

Here is the caller graph for this function:

◆ TxnBegin()

DbTxn* BerkeleyEnvironment::TxnBegin ( int  flags = DB_TXN_WRITE_NOSYNC)
inline

Definition at line 80 of file bdb.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Verify()

bool BerkeleyEnvironment::Verify ( const std::string &  strFile)

Definition at line 246 of file bdb.cpp.

Member Data Documentation

◆ dbenv

std::unique_ptr<DbEnv> BerkeleyEnvironment::dbenv

Definition at line 54 of file bdb.h.

◆ fDbEnvInit

bool BerkeleyEnvironment::fDbEnvInit
private

Definition at line 47 of file bdb.h.

◆ fMockDb

bool BerkeleyEnvironment::fMockDb
private

Definition at line 48 of file bdb.h.

◆ m_databases

std::map<std::string, std::reference_wrapper<BerkeleyDatabase> > BerkeleyEnvironment::m_databases

Definition at line 56 of file bdb.h.

◆ m_db_in_use

std::condition_variable_any BerkeleyEnvironment::m_db_in_use

Definition at line 58 of file bdb.h.

◆ m_fileids

std::unordered_map<std::string, WalletDatabaseFileId> BerkeleyEnvironment::m_fileids

Definition at line 57 of file bdb.h.

◆ mapFileUseCount

std::map<std::string, int> BerkeleyEnvironment::mapFileUseCount

Definition at line 55 of file bdb.h.

◆ strPath

std::string BerkeleyEnvironment::strPath
private

Definition at line 51 of file bdb.h.


The documentation for this class was generated from the following files: