Bitcoin Core  22.99.0
P2P Digital Currency
Classes | 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]

Classes

class  SafeDbt
 RAII class that automatically cleanses its data on destruction. More...
 

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
 
bool StartCursor () override
 
bool ReadAtCursor (CDataStream &ssKey, CDataStream &ssValue, bool &complete) override
 
void CloseCursor () 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
 
std::string strFile
 
DbTxn * activeTxn
 
Dbc * m_cursor
 
bool fReadOnly
 
bool fFlushOnClose
 
BerkeleyEnvironmentenv
 
BerkeleyDatabasem_database
 

Private Member Functions

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

Detailed Description

RAII class that provides access to a Berkeley database.

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

Here is the call graph for this function:

◆ ~BerkeleyBatch()

wallet::BerkeleyBatch::~BerkeleyBatch ( )
override

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

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

◆ CloseCursor()

void wallet::BerkeleyBatch::CloseCursor ( )
overridevirtual

Implements wallet::DatabaseBatch.

Definition at line 692 of file bdb.cpp.

Here is the caller graph for this function:

◆ EraseKey()

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

Implements wallet::DatabaseBatch.

Definition at line 781 of file bdb.cpp.

Here is the call graph for this function:

◆ Flush()

void wallet::BerkeleyBatch::Flush ( )
overridevirtual

Implements wallet::DatabaseBatch.

Definition at line 369 of file bdb.cpp.

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

◆ HasKey()

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

Implements wallet::DatabaseBatch.

Definition at line 794 of file bdb.cpp.

◆ operator=()

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

◆ ReadAtCursor()

bool wallet::BerkeleyBatch::ReadAtCursor ( CDataStream ssKey,
CDataStream ssValue,
bool &  complete 
)
overridevirtual

Implements wallet::DatabaseBatch.

Definition at line 666 of file bdb.cpp.

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

◆ ReadKey()

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

Implements wallet::DatabaseBatch.

Definition at line 750 of file bdb.cpp.

Here is the call graph for this function:

◆ StartCursor()

bool wallet::BerkeleyBatch::StartCursor ( )
overridevirtual

Implements wallet::DatabaseBatch.

Definition at line 657 of file bdb.cpp.

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

◆ TxnAbort()

bool wallet::BerkeleyBatch::TxnAbort ( )
overridevirtual

Implements wallet::DatabaseBatch.

Definition at line 719 of file bdb.cpp.

◆ TxnBegin()

bool wallet::BerkeleyBatch::TxnBegin ( )
overridevirtual

Implements wallet::DatabaseBatch.

Definition at line 699 of file bdb.cpp.

Here is the call graph for this function:

◆ TxnCommit()

bool wallet::BerkeleyBatch::TxnCommit ( )
overridevirtual

Implements wallet::DatabaseBatch.

Definition at line 710 of file bdb.cpp.

◆ WriteKey()

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

Implements wallet::DatabaseBatch.

Definition at line 766 of file bdb.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ activeTxn

DbTxn* wallet::BerkeleyBatch::activeTxn
protected

Definition at line 200 of file bdb.h.

◆ env

BerkeleyEnvironment* wallet::BerkeleyBatch::env
protected

Definition at line 204 of file bdb.h.

◆ fFlushOnClose

bool wallet::BerkeleyBatch::fFlushOnClose
protected

Definition at line 203 of file bdb.h.

◆ fReadOnly

bool wallet::BerkeleyBatch::fReadOnly
protected

Definition at line 202 of file bdb.h.

◆ m_cursor

Dbc* wallet::BerkeleyBatch::m_cursor
protected

Definition at line 201 of file bdb.h.

◆ m_database

BerkeleyDatabase& wallet::BerkeleyBatch::m_database
protected

Definition at line 205 of file bdb.h.

◆ pdb

Db* wallet::BerkeleyBatch::pdb
protected

Definition at line 198 of file bdb.h.

◆ strFile

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

Definition at line 199 of file bdb.h.


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