Bitcoin ABC 0.30.7
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
 
virtual void Flush ()=0
 
virtual void Close ()=0
 
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)
 
virtual bool StartCursor ()=0
 
virtual bool ReadAtCursor (CDataStream &ssKey, CDataStream &ssValue, bool &complete)=0
 
virtual void CloseCursor ()=0
 
virtual bool TxnBegin ()=0
 
virtual bool TxnCommit ()=0
 
virtual bool TxnAbort ()=0
 

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 187 of file bdb.h.

Constructor & Destructor Documentation

◆ BerkeleyBatch() [1/2]

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

Definition at line 333 of file bdb.cpp.

Here is the call graph for this function:

◆ ~BerkeleyBatch()

BerkeleyBatch::~BerkeleyBatch ( )
override

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

Here is the caller graph for this function:

◆ EraseKey()

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

Implements DatabaseBatch.

Definition at line 853 of file bdb.cpp.

Here is the call graph for this function:

◆ Flush()

void BerkeleyBatch::Flush ( )
overridevirtual

Implements DatabaseBatch.

Definition at line 405 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 867 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 747 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 818 of file bdb.cpp.

Here is the call graph for this function:

◆ StartCursor()

bool BerkeleyBatch::StartCursor ( )
overridevirtual

Implements DatabaseBatch.

Definition at line 738 of file bdb.cpp.

Here is the call graph for this function:

◆ TxnAbort()

bool BerkeleyBatch::TxnAbort ( )
overridevirtual

Implements DatabaseBatch.

Definition at line 805 of file bdb.cpp.

◆ TxnBegin()

bool BerkeleyBatch::TxnBegin ( )
overridevirtual

Implements DatabaseBatch.

Definition at line 784 of file bdb.cpp.

Here is the call graph for this function:

◆ TxnCommit()

bool BerkeleyBatch::TxnCommit ( )
overridevirtual

Implements DatabaseBatch.

Definition at line 796 of file bdb.cpp.

◆ WriteKey()

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

Implements DatabaseBatch.

Definition at line 834 of file bdb.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ activeTxn

DbTxn* BerkeleyBatch::activeTxn
protected

Definition at line 217 of file bdb.h.

◆ env

BerkeleyEnvironment* BerkeleyBatch::env
protected

Definition at line 221 of file bdb.h.

◆ fFlushOnClose

bool BerkeleyBatch::fFlushOnClose
protected

Definition at line 220 of file bdb.h.

◆ fReadOnly

bool BerkeleyBatch::fReadOnly
protected

Definition at line 219 of file bdb.h.

◆ m_cursor

Dbc* BerkeleyBatch::m_cursor
protected

Definition at line 218 of file bdb.h.

◆ m_database

BerkeleyDatabase& BerkeleyBatch::m_database
protected

Definition at line 222 of file bdb.h.

◆ pdb

Db* BerkeleyBatch::pdb
protected

Definition at line 215 of file bdb.h.

◆ strFile

std::string BerkeleyBatch::strFile
protected

Definition at line 216 of file bdb.h.


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