Bitcoin Core  22.99.0
P2P Digital Currency
Public Member Functions | Public Attributes | Private Attributes | List of all members
wallet::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
 
fs::path Directory () const
 
bool Open (bilingual_str &error)
 
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, 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 45 of file bdb.h.

Constructor & Destructor Documentation

◆ BerkeleyEnvironment() [1/2]

wallet::BerkeleyEnvironment::BerkeleyEnvironment ( const fs::path env_directory)
explicit

Definition at line 116 of file bdb.cpp.

Here is the call graph for this function:

◆ BerkeleyEnvironment() [2/2]

wallet::BerkeleyEnvironment::BerkeleyEnvironment ( )

Construct an in-memory mock Berkeley environment for testing.

Definition at line 191 of file bdb.cpp.

Here is the call graph for this function:

◆ ~BerkeleyEnvironment()

wallet::BerkeleyEnvironment::~BerkeleyEnvironment ( )

Definition at line 121 of file bdb.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ CheckpointLSN()

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

Definition at line 287 of file bdb.cpp.

◆ Close()

void wallet::BerkeleyEnvironment::Close ( )

Definition at line 79 of file bdb.cpp.

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

◆ CloseDb()

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

Definition at line 409 of file bdb.cpp.

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

◆ Directory()

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

Definition at line 67 of file bdb.h.

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

◆ Flush()

void wallet::BerkeleyEnvironment::Flush ( bool  fShutdown)

Definition at line 535 of file bdb.cpp.

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

◆ IsInitialized()

bool wallet::BerkeleyEnvironment::IsInitialized ( ) const
inline

Definition at line 66 of file bdb.h.

◆ IsMock()

bool wallet::BerkeleyEnvironment::IsMock ( ) const
inline

Definition at line 65 of file bdb.h.

◆ Open()

bool wallet::BerkeleyEnvironment::Open ( bilingual_str error)

debug

Definition at line 128 of file bdb.cpp.

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

◆ ReloadDbEnv()

void wallet::BerkeleyEnvironment::ReloadDbEnv ( )

Definition at line 424 of file bdb.cpp.

Here is the call graph for this function:

◆ Reset()

void wallet::BerkeleyEnvironment::Reset ( )

Definition at line 109 of file bdb.cpp.

Here is the caller graph for this function:

◆ TxnBegin()

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

Definition at line 77 of file bdb.h.

Here is the caller graph for this function:

Member Data Documentation

◆ dbenv

std::unique_ptr<DbEnv> wallet::BerkeleyEnvironment::dbenv

Definition at line 55 of file bdb.h.

◆ fDbEnvInit

bool wallet::BerkeleyEnvironment::fDbEnvInit
private

Definition at line 48 of file bdb.h.

◆ fMockDb

bool wallet::BerkeleyEnvironment::fMockDb
private

Definition at line 49 of file bdb.h.

◆ m_databases

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

Definition at line 56 of file bdb.h.

◆ m_db_in_use

std::condition_variable_any wallet::BerkeleyEnvironment::m_db_in_use

Definition at line 58 of file bdb.h.

◆ m_fileids

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

Definition at line 57 of file bdb.h.

◆ strPath

std::string wallet::BerkeleyEnvironment::strPath
private

Definition at line 52 of file bdb.h.


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