Bitcoin ABC  0.28.12
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 186 of file bdb.h.

Constructor & Destructor Documentation

◆ BerkeleyBatch() [1/2]

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

Definition at line 328 of file bdb.cpp.

Here is the call graph for this function:

◆ ~BerkeleyBatch()

BerkeleyBatch::~BerkeleyBatch ( )
override

Definition at line 426 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 431 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 771 of file bdb.cpp.

Here is the caller graph for this function:

◆ EraseKey()

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

Implements DatabaseBatch.

Definition at line 848 of file bdb.cpp.

Here is the call graph for this function:

◆ Flush()

void BerkeleyBatch::Flush ( )
overridevirtual

Implements DatabaseBatch.

Definition at line 400 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 862 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 742 of file bdb.cpp.

Here is the call graph for this function:

◆ ReadKey()

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

Implements DatabaseBatch.

Definition at line 813 of file bdb.cpp.

Here is the call graph for this function:

◆ StartCursor()

bool BerkeleyBatch::StartCursor ( )
overridevirtual

Implements DatabaseBatch.

Definition at line 733 of file bdb.cpp.

Here is the call graph for this function:

◆ TxnAbort()

bool BerkeleyBatch::TxnAbort ( )
overridevirtual

Implements DatabaseBatch.

Definition at line 800 of file bdb.cpp.

◆ TxnBegin()

bool BerkeleyBatch::TxnBegin ( )
overridevirtual

Implements DatabaseBatch.

Definition at line 779 of file bdb.cpp.

Here is the call graph for this function:

◆ TxnCommit()

bool BerkeleyBatch::TxnCommit ( )
overridevirtual

Implements DatabaseBatch.

Definition at line 791 of file bdb.cpp.

◆ WriteKey()

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

Implements DatabaseBatch.

Definition at line 829 of file bdb.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ activeTxn

DbTxn* BerkeleyBatch::activeTxn
protected

Definition at line 216 of file bdb.h.

◆ env

BerkeleyEnvironment* BerkeleyBatch::env
protected

Definition at line 220 of file bdb.h.

◆ fFlushOnClose

bool BerkeleyBatch::fFlushOnClose
protected

Definition at line 219 of file bdb.h.

◆ fReadOnly

bool BerkeleyBatch::fReadOnly
protected

Definition at line 218 of file bdb.h.

◆ m_cursor

Dbc* BerkeleyBatch::m_cursor
protected

Definition at line 217 of file bdb.h.

◆ m_database

BerkeleyDatabase& BerkeleyBatch::m_database
protected

Definition at line 221 of file bdb.h.

◆ pdb

Db* BerkeleyBatch::pdb
protected

Definition at line 214 of file bdb.h.

◆ strFile

std::string BerkeleyBatch::strFile
protected

Definition at line 215 of file bdb.h.


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