Bitcoin Core 28.99.0
P2P Digital Currency
Public Member Functions | Private Member Functions | Private Attributes | List of all members
wallet::MockableBatch Class Reference

#include <util.h>

Inheritance diagram for wallet::MockableBatch:
[legend]
Collaboration diagram for wallet::MockableBatch:
[legend]

Public Member Functions

 MockableBatch (MockableData &records, bool pass)
 
 ~MockableBatch ()=default
 
void Flush () override
 
void Close () override
 
std::unique_ptr< DatabaseCursorGetNewCursor () override
 
std::unique_ptr< DatabaseCursorGetNewPrefixCursor (Span< const std::byte > prefix) override
 
bool TxnBegin () override
 
bool TxnCommit () override
 
bool TxnAbort () override
 
bool HasActiveTxn () override
 
- Public Member Functions inherited from wallet::DatabaseBatch
 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

bool ReadKey (DataStream &&key, DataStream &value) override
 
bool WriteKey (DataStream &&key, DataStream &&value, bool overwrite=true) override
 
bool EraseKey (DataStream &&key) override
 
bool HasKey (DataStream &&key) override
 
bool ErasePrefix (Span< const std::byte > prefix) override
 

Private Attributes

MockableDatam_records
 
bool m_pass
 

Detailed Description

Definition at line 69 of file util.h.

Constructor & Destructor Documentation

◆ MockableBatch()

wallet::MockableBatch::MockableBatch ( MockableData records,
bool  pass 
)
inlineexplicit

Definition at line 82 of file util.h.

◆ ~MockableBatch()

wallet::MockableBatch::~MockableBatch ( )
default

Member Function Documentation

◆ Close()

void wallet::MockableBatch::Close ( )
inlineoverridevirtual

Implements wallet::DatabaseBatch.

Definition at line 86 of file util.h.

◆ EraseKey()

bool wallet::MockableBatch::EraseKey ( DataStream &&  key)
overrideprivatevirtual

Implements wallet::DatabaseBatch.

Definition at line 150 of file util.cpp.

◆ ErasePrefix()

bool wallet::MockableBatch::ErasePrefix ( Span< const std::byte >  prefix)
overrideprivatevirtual

Implements wallet::DatabaseBatch.

Definition at line 169 of file util.cpp.

◆ Flush()

void wallet::MockableBatch::Flush ( )
inlineoverridevirtual

Implements wallet::DatabaseBatch.

Definition at line 85 of file util.h.

◆ GetNewCursor()

std::unique_ptr< DatabaseCursor > wallet::MockableBatch::GetNewCursor ( )
inlineoverridevirtual

Implements wallet::DatabaseBatch.

Definition at line 88 of file util.h.

◆ GetNewPrefixCursor()

std::unique_ptr< DatabaseCursor > wallet::MockableBatch::GetNewPrefixCursor ( Span< const std::byte >  prefix)
inlineoverridevirtual

Implements wallet::DatabaseBatch.

Definition at line 92 of file util.h.

◆ HasActiveTxn()

bool wallet::MockableBatch::HasActiveTxn ( )
inlineoverridevirtual

Implements wallet::DatabaseBatch.

Definition at line 98 of file util.h.

◆ HasKey()

bool wallet::MockableBatch::HasKey ( DataStream &&  key)
overrideprivatevirtual

Implements wallet::DatabaseBatch.

Definition at line 160 of file util.cpp.

◆ ReadKey()

bool wallet::MockableBatch::ReadKey ( DataStream &&  key,
DataStream value 
)
overrideprivatevirtual

Implements wallet::DatabaseBatch.

Definition at line 120 of file util.cpp.

Here is the call graph for this function:

◆ TxnAbort()

bool wallet::MockableBatch::TxnAbort ( )
inlineoverridevirtual

Implements wallet::DatabaseBatch.

Definition at line 97 of file util.h.

◆ TxnBegin()

bool wallet::MockableBatch::TxnBegin ( )
inlineoverridevirtual

Implements wallet::DatabaseBatch.

Definition at line 95 of file util.h.

◆ TxnCommit()

bool wallet::MockableBatch::TxnCommit ( )
inlineoverridevirtual

Implements wallet::DatabaseBatch.

Definition at line 96 of file util.h.

◆ WriteKey()

bool wallet::MockableBatch::WriteKey ( DataStream &&  key,
DataStream &&  value,
bool  overwrite = true 
)
overrideprivatevirtual

Implements wallet::DatabaseBatch.

Definition at line 135 of file util.cpp.

Member Data Documentation

◆ m_pass

bool wallet::MockableBatch::m_pass
private

Definition at line 73 of file util.h.

◆ m_records

MockableData& wallet::MockableBatch::m_records
private

Definition at line 72 of file util.h.


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