Bitcoin Core 28.99.0
P2P Digital Currency
Public Member Functions | Private Member Functions | List of all members
wallet::DatabaseBatch Class Referenceabstract

RAII class that provides access to a WalletDatabase. More...

#include <db.h>

Inheritance diagram for wallet::DatabaseBatch:
[legend]

Public Member Functions

 DatabaseBatch ()=default
 
virtual ~DatabaseBatch ()=default
 
 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 ErasePrefix (Span< const std::byte > prefix)=0
 
virtual std::unique_ptr< DatabaseCursorGetNewCursor ()=0
 
virtual std::unique_ptr< DatabaseCursorGetNewPrefixCursor (Span< const std::byte > prefix)=0
 
virtual bool TxnBegin ()=0
 
virtual bool TxnCommit ()=0
 
virtual bool TxnAbort ()=0
 
virtual bool HasActiveTxn ()=0
 

Private Member Functions

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

Detailed Description

RAII class that provides access to a WalletDatabase.

Definition at line 50 of file db.h.

Constructor & Destructor Documentation

◆ DatabaseBatch() [1/2]

wallet::DatabaseBatch::DatabaseBatch ( )
explicitdefault

◆ ~DatabaseBatch()

virtual wallet::DatabaseBatch::~DatabaseBatch ( )
virtualdefault

◆ DatabaseBatch() [2/2]

wallet::DatabaseBatch::DatabaseBatch ( const DatabaseBatch )
delete

Member Function Documentation

◆ Close()

virtual void wallet::DatabaseBatch::Close ( )
pure virtual

◆ Erase()

template<typename K >
bool wallet::DatabaseBatch::Erase ( const K &  key)
inline

Definition at line 100 of file db.h.

Here is the call graph for this function:

◆ EraseKey()

virtual bool wallet::DatabaseBatch::EraseKey ( DataStream &&  key)
privatepure virtual

Implemented in wallet::BerkeleyBatch, wallet::BerkeleyROBatch, wallet::DummyBatch, wallet::SQLiteBatch, and wallet::MockableBatch.

Here is the caller graph for this function:

◆ ErasePrefix()

virtual bool wallet::DatabaseBatch::ErasePrefix ( Span< const std::byte >  prefix)
pure virtual

◆ Exists()

template<typename K >
bool wallet::DatabaseBatch::Exists ( const K &  key)
inline

Definition at line 110 of file db.h.

Here is the call graph for this function:

◆ Flush()

virtual void wallet::DatabaseBatch::Flush ( )
pure virtual

◆ GetNewCursor()

virtual std::unique_ptr< DatabaseCursor > wallet::DatabaseBatch::GetNewCursor ( )
pure virtual

◆ GetNewPrefixCursor()

virtual std::unique_ptr< DatabaseCursor > wallet::DatabaseBatch::GetNewPrefixCursor ( Span< const std::byte >  prefix)
pure virtual

Implemented in wallet::BerkeleyBatch, wallet::BerkeleyROBatch, wallet::DummyBatch, wallet::SQLiteBatch, and wallet::MockableBatch.

Here is the caller graph for this function:

◆ HasActiveTxn()

virtual bool wallet::DatabaseBatch::HasActiveTxn ( )
pure virtual

◆ HasKey()

virtual bool wallet::DatabaseBatch::HasKey ( DataStream &&  key)
privatepure virtual

Implemented in wallet::BerkeleyBatch, wallet::BerkeleyROBatch, wallet::DummyBatch, wallet::SQLiteBatch, and wallet::MockableBatch.

Here is the caller graph for this function:

◆ operator=()

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

◆ Read()

template<typename K , typename T >
bool wallet::DatabaseBatch::Read ( const K &  key,
T &  value 
)
inline

Definition at line 69 of file db.h.

Here is the call graph for this function:

◆ ReadKey()

virtual bool wallet::DatabaseBatch::ReadKey ( DataStream &&  key,
DataStream value 
)
privatepure virtual

Implemented in wallet::BerkeleyBatch, wallet::BerkeleyROBatch, wallet::DummyBatch, wallet::SQLiteBatch, and wallet::MockableBatch.

Here is the caller graph for this function:

◆ TxnAbort()

virtual bool wallet::DatabaseBatch::TxnAbort ( )
pure virtual

◆ TxnBegin()

virtual bool wallet::DatabaseBatch::TxnBegin ( )
pure virtual

◆ TxnCommit()

virtual bool wallet::DatabaseBatch::TxnCommit ( )
pure virtual

◆ Write()

template<typename K , typename T >
bool wallet::DatabaseBatch::Write ( const K &  key,
const T &  value,
bool  fOverwrite = true 
)
inline

Definition at line 86 of file db.h.

Here is the call graph for this function:

◆ WriteKey()

virtual bool wallet::DatabaseBatch::WriteKey ( DataStream &&  key,
DataStream &&  value,
bool  overwrite = true 
)
privatepure virtual

Implemented in wallet::BerkeleyBatch, wallet::BerkeleyROBatch, wallet::DummyBatch, wallet::SQLiteBatch, and wallet::MockableBatch.

Here is the caller graph for this function:

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