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

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

#include <bdb.h>

Inheritance diagram for BerkeleyBatch:
[legend]
Collaboration diagram for 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 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 171 of file bdb.h.

Constructor & Destructor Documentation

◆ BerkeleyBatch() [1/2]

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

Definition at line 308 of file bdb.cpp.

Here is the call graph for this function:

◆ ~BerkeleyBatch()

BerkeleyBatch::~BerkeleyBatch ( )
override

Definition at line 390 of file bdb.cpp.

Here is the call graph for this function:

◆ BerkeleyBatch() [2/2]

BerkeleyBatch::BerkeleyBatch ( const BerkeleyBatch )
delete

Member Function Documentation

◆ Close()

void BerkeleyBatch::Close ( )
overridevirtual

Implements DatabaseBatch.

Definition at line 396 of file bdb.cpp.

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

◆ CloseCursor()

void BerkeleyBatch::CloseCursor ( )
overridevirtual

Implements DatabaseBatch.

Definition at line 693 of file bdb.cpp.

Here is the caller graph for this function:

◆ EraseKey()

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

Implements DatabaseBatch.

Definition at line 765 of file bdb.cpp.

◆ Flush()

void BerkeleyBatch::Flush ( )
overridevirtual

Implements DatabaseBatch.

Definition at line 370 of file bdb.cpp.

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

◆ HasKey()

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

Implements DatabaseBatch.

Definition at line 778 of file bdb.cpp.

◆ operator=()

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

◆ ReadAtCursor()

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

Implements DatabaseBatch.

Definition at line 667 of file bdb.cpp.

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

◆ ReadKey()

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

Implements DatabaseBatch.

Definition at line 734 of file bdb.cpp.

Here is the call graph for this function:

◆ StartCursor()

bool BerkeleyBatch::StartCursor ( )
overridevirtual

Implements DatabaseBatch.

Definition at line 658 of file bdb.cpp.

Here is the caller graph for this function:

◆ TxnAbort()

bool BerkeleyBatch::TxnAbort ( )
overridevirtual

Implements DatabaseBatch.

Definition at line 720 of file bdb.cpp.

◆ TxnBegin()

bool BerkeleyBatch::TxnBegin ( )
overridevirtual

Implements DatabaseBatch.

Definition at line 700 of file bdb.cpp.

Here is the call graph for this function:

◆ TxnCommit()

bool BerkeleyBatch::TxnCommit ( )
overridevirtual

Implements DatabaseBatch.

Definition at line 711 of file bdb.cpp.

◆ WriteKey()

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

Implements DatabaseBatch.

Definition at line 750 of file bdb.cpp.

Member Data Documentation

◆ activeTxn

DbTxn* BerkeleyBatch::activeTxn
protected

Definition at line 202 of file bdb.h.

◆ env

BerkeleyEnvironment* BerkeleyBatch::env
protected

Definition at line 206 of file bdb.h.

◆ fFlushOnClose

bool BerkeleyBatch::fFlushOnClose
protected

Definition at line 205 of file bdb.h.

◆ fReadOnly

bool BerkeleyBatch::fReadOnly
protected

Definition at line 204 of file bdb.h.

◆ m_cursor

Dbc* BerkeleyBatch::m_cursor
protected

Definition at line 203 of file bdb.h.

◆ m_database

BerkeleyDatabase& BerkeleyBatch::m_database
protected

Definition at line 207 of file bdb.h.

◆ pdb

Db* BerkeleyBatch::pdb
protected

Definition at line 200 of file bdb.h.

◆ strFile

std::string BerkeleyBatch::strFile
protected

Definition at line 201 of file bdb.h.


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