Bitcoin Core  24.99.0
P2P Digital Currency
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
wallet::BerkeleyBatch Class Reference

RAII class that provides access to a Berkeley database. More...

#include <bdb.h>

Inheritance diagram for wallet::BerkeleyBatch:
[legend]
Collaboration diagram for wallet::BerkeleyBatch:
[legend]

Public Member Functions

 BerkeleyBatch (BerkeleyDatabase &database, const bool fReadOnly, bool fFlushOnCloseIn=true)
 
 ~BerkeleyBatch () override
 
 BerkeleyBatch (const BerkeleyBatch &)=delete
 
BerkeleyBatchoperator= (const BerkeleyBatch &)=delete
 
void Flush () override
 
void Close () override
 
std::unique_ptr< DatabaseCursorGetNewCursor () override
 
bool TxnBegin () override
 
bool TxnCommit () override
 
bool TxnAbort () override
 
- Public Member Functions inherited from wallet::DatabaseBatch
 DatabaseBatch ()
 
virtual ~DatabaseBatch ()
 
 DatabaseBatch (const DatabaseBatch &)=delete
 
DatabaseBatchoperator= (const DatabaseBatch &)=delete
 
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)
 

Protected Attributes

Db * pdb {nullptr}
 
std::string strFile
 
DbTxn * activeTxn {nullptr}
 
bool fReadOnly
 
bool fFlushOnClose
 
BerkeleyEnvironmentenv
 
BerkeleyDatabasem_database
 

Private Member Functions

bool ReadKey (DataStream &&key, DataStream &value) override
 
bool WriteKey (DataStream &&key, DataStream &&value, bool overwrite=true) override
 
bool EraseKey (DataStream &&key) override
 
bool HasKey (DataStream &&key) override
 

Detailed Description

RAII class that provides access to a Berkeley database.

Definition at line 201 of file bdb.h.

Constructor & Destructor Documentation

◆ BerkeleyBatch() [1/2]

wallet::BerkeleyBatch::BerkeleyBatch ( BerkeleyDatabase database,
const bool  fReadOnly,
bool  fFlushOnCloseIn = true 
)
explicit

Definition at line 311 of file bdb.cpp.

Here is the call graph for this function:

◆ ~BerkeleyBatch()

wallet::BerkeleyBatch::~BerkeleyBatch ( )
override

Definition at line 388 of file bdb.cpp.

Here is the call graph for this function:

◆ BerkeleyBatch() [2/2]

wallet::BerkeleyBatch::BerkeleyBatch ( const BerkeleyBatch )
delete

Member Function Documentation

◆ Close()

void wallet::BerkeleyBatch::Close ( )
overridevirtual

Implements wallet::DatabaseBatch.

Definition at line 394 of file bdb.cpp.

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

◆ EraseKey()

bool wallet::BerkeleyBatch::EraseKey ( DataStream &&  key)
overrideprivatevirtual

Implements wallet::DatabaseBatch.

Definition at line 788 of file bdb.cpp.

Here is the call graph for this function:

◆ Flush()

void wallet::BerkeleyBatch::Flush ( )
overridevirtual

Implements wallet::DatabaseBatch.

Definition at line 368 of file bdb.cpp.

Here is the caller graph for this function:

◆ GetNewCursor()

std::unique_ptr< DatabaseCursor > wallet::BerkeleyBatch::GetNewCursor ( )
overridevirtual

Implements wallet::DatabaseBatch.

Definition at line 700 of file bdb.cpp.

Here is the caller graph for this function:

◆ HasKey()

bool wallet::BerkeleyBatch::HasKey ( DataStream &&  key)
overrideprivatevirtual

Implements wallet::DatabaseBatch.

Definition at line 801 of file bdb.cpp.

◆ operator=()

BerkeleyBatch& wallet::BerkeleyBatch::operator= ( const BerkeleyBatch )
delete

◆ ReadKey()

bool wallet::BerkeleyBatch::ReadKey ( DataStream &&  key,
DataStream value 
)
overrideprivatevirtual

Implements wallet::DatabaseBatch.

Definition at line 757 of file bdb.cpp.

Here is the call graph for this function:

◆ TxnAbort()

bool wallet::BerkeleyBatch::TxnAbort ( )
overridevirtual

Implements wallet::DatabaseBatch.

Definition at line 726 of file bdb.cpp.

◆ TxnBegin()

bool wallet::BerkeleyBatch::TxnBegin ( )
overridevirtual

Implements wallet::DatabaseBatch.

Definition at line 706 of file bdb.cpp.

Here is the call graph for this function:

◆ TxnCommit()

bool wallet::BerkeleyBatch::TxnCommit ( )
overridevirtual

Implements wallet::DatabaseBatch.

Definition at line 717 of file bdb.cpp.

◆ WriteKey()

bool wallet::BerkeleyBatch::WriteKey ( DataStream &&  key,
DataStream &&  value,
bool  overwrite = true 
)
overrideprivatevirtual

Implements wallet::DatabaseBatch.

Definition at line 773 of file bdb.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ activeTxn

DbTxn* wallet::BerkeleyBatch::activeTxn {nullptr}
protected

Definition at line 212 of file bdb.h.

◆ env

BerkeleyEnvironment* wallet::BerkeleyBatch::env
protected

Definition at line 215 of file bdb.h.

◆ fFlushOnClose

bool wallet::BerkeleyBatch::fFlushOnClose
protected

Definition at line 214 of file bdb.h.

◆ fReadOnly

bool wallet::BerkeleyBatch::fReadOnly
protected

Definition at line 213 of file bdb.h.

◆ m_database

BerkeleyDatabase& wallet::BerkeleyBatch::m_database
protected

Definition at line 216 of file bdb.h.

◆ pdb

Db* wallet::BerkeleyBatch::pdb {nullptr}
protected

Definition at line 210 of file bdb.h.

◆ strFile

std::string wallet::BerkeleyBatch::strFile
protected

Definition at line 211 of file bdb.h.


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