Bitcoin ABC  0.29.2
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 ()
 
void MakeMock ()
 
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 37 of file bdb.h.

Constructor & Destructor Documentation

◆ BerkeleyEnvironment() [1/2]

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

Definition at line 138 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 222 of file bdb.cpp.

Here is the call graph for this function:

◆ ~BerkeleyEnvironment()

BerkeleyEnvironment::~BerkeleyEnvironment ( )

Definition at line 143 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 309 of file bdb.cpp.

◆ Close()

void BerkeleyEnvironment::Close ( )

Definition at line 96 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 447 of file bdb.cpp.

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

◆ Directory()

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

Definition at line 60 of file bdb.h.

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

◆ Flush()

void BerkeleyEnvironment::Flush ( bool  fShutdown)

Definition at line 588 of file bdb.cpp.

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

◆ IsInitialized()

bool BerkeleyEnvironment::IsInitialized ( ) const
inline

Definition at line 59 of file bdb.h.

◆ IsMock()

bool BerkeleyEnvironment::IsMock ( ) const
inline

Definition at line 58 of file bdb.h.

◆ MakeMock()

void BerkeleyEnvironment::MakeMock ( )

◆ Open()

bool BerkeleyEnvironment::Open ( bilingual_str error)

debug

Definition at line 149 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 459 of file bdb.cpp.

Here is the call graph for this function:

◆ Reset()

void BerkeleyEnvironment::Reset ( )

Definition at line 132 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 70 of file bdb.h.

Here is the caller graph for this function:

Member Data Documentation

◆ dbenv

std::unique_ptr<DbEnv> BerkeleyEnvironment::dbenv

Definition at line 47 of file bdb.h.

◆ fDbEnvInit

bool BerkeleyEnvironment::fDbEnvInit
private

Definition at line 39 of file bdb.h.

◆ fMockDb

bool BerkeleyEnvironment::fMockDb
private

Definition at line 40 of file bdb.h.

◆ m_databases

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

Definition at line 48 of file bdb.h.

◆ m_db_in_use

std::condition_variable_any BerkeleyEnvironment::m_db_in_use

Definition at line 50 of file bdb.h.

◆ m_fileids

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

Definition at line 49 of file bdb.h.

◆ strPath

std::string BerkeleyEnvironment::strPath
private

Definition at line 44 of file bdb.h.


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