Bitcoin Core  22.99.0
P2P Digital Currency
Public Member Functions | List of all members
DummyDatabase Class Reference

A dummy WalletDatabase that does nothing and never fails. More...

#include <db.h>

Inheritance diagram for DummyDatabase:
[legend]
Collaboration diagram for DummyDatabase:
[legend]

Public Member Functions

void Open () override
 Open the database if it is not already opened. More...
 
void AddRef () override
 Indicate the a new database user has began using the database. More...
 
void RemoveRef () override
 Indicate that database user has stopped using the database and that it could be flushed or closed. More...
 
bool Rewrite (const char *pszSkip=nullptr) override
 Rewrite the entire database on disk, with the exception of key pszSkip if non-zero. More...
 
bool Backup (const std::string &strDest) const override
 Back up the entire database to a file. More...
 
void Close () override
 Flush to the database file and close the database. More...
 
void Flush () override
 Make sure all changes are flushed to database file. More...
 
bool PeriodicFlush () override
 
void IncrementUpdateCounter () override
 
void ReloadDbEnv () override
 
std::string Filename () override
 Return path to main database file for logs and error messages. More...
 
std::string Format () override
 
std::unique_ptr< DatabaseBatchMakeBatch (bool flush_on_close=true) override
 Make a DatabaseBatch connected to this database. More...
 
- Public Member Functions inherited from WalletDatabase
 WalletDatabase ()
 Create dummy DB handle. More...
 
virtual ~WalletDatabase ()
 

Additional Inherited Members

- Public Attributes inherited from WalletDatabase
std::atomic< int > m_refcount {0}
 Counts the number of active database users to be sure that the database is not closed while someone is using it. More...
 
std::atomic< unsigned int > nUpdateCounter
 
unsigned int nLastSeen
 
unsigned int nLastFlushed
 
int64_t nLastWalletUpdate
 

Detailed Description

A dummy WalletDatabase that does nothing and never fails.

Only used by unit tests.

Definition at line 180 of file db.h.

Member Function Documentation

◆ AddRef()

void DummyDatabase::AddRef ( )
inlineoverridevirtual

Indicate the a new database user has began using the database.

Increments m_refcount

Implements WalletDatabase.

Definition at line 184 of file db.h.

◆ Backup()

bool DummyDatabase::Backup ( const std::string &  strDest) const
inlineoverridevirtual

Back up the entire database to a file.

Implements WalletDatabase.

Definition at line 187 of file db.h.

◆ Close()

void DummyDatabase::Close ( )
inlineoverridevirtual

Flush to the database file and close the database.

Also close the environment if no other databases are open in it.

Implements WalletDatabase.

Definition at line 188 of file db.h.

◆ Filename()

std::string DummyDatabase::Filename ( )
inlineoverridevirtual

Return path to main database file for logs and error messages.

Implements WalletDatabase.

Definition at line 193 of file db.h.

◆ Flush()

void DummyDatabase::Flush ( )
inlineoverridevirtual

Make sure all changes are flushed to database file.

Implements WalletDatabase.

Definition at line 189 of file db.h.

◆ Format()

std::string DummyDatabase::Format ( )
inlineoverridevirtual

Implements WalletDatabase.

Definition at line 194 of file db.h.

◆ IncrementUpdateCounter()

void DummyDatabase::IncrementUpdateCounter ( )
inlineoverridevirtual

Implements WalletDatabase.

Definition at line 191 of file db.h.

◆ MakeBatch()

std::unique_ptr<DatabaseBatch> DummyDatabase::MakeBatch ( bool  flush_on_close = true)
inlineoverridevirtual

Make a DatabaseBatch connected to this database.

Implements WalletDatabase.

Definition at line 195 of file db.h.

◆ Open()

void DummyDatabase::Open ( )
inlineoverridevirtual

Open the database if it is not already opened.

Implements WalletDatabase.

Definition at line 183 of file db.h.

◆ PeriodicFlush()

bool DummyDatabase::PeriodicFlush ( )
inlineoverridevirtual

Implements WalletDatabase.

Definition at line 190 of file db.h.

◆ ReloadDbEnv()

void DummyDatabase::ReloadDbEnv ( )
inlineoverridevirtual

Implements WalletDatabase.

Definition at line 192 of file db.h.

◆ RemoveRef()

void DummyDatabase::RemoveRef ( )
inlineoverridevirtual

Indicate that database user has stopped using the database and that it could be flushed or closed.

Decrement m_refcount

Implements WalletDatabase.

Definition at line 185 of file db.h.

◆ Rewrite()

bool DummyDatabase::Rewrite ( const char *  pszSkip = nullptr)
inlineoverridevirtual

Rewrite the entire database on disk, with the exception of key pszSkip if non-zero.

Implements WalletDatabase.

Definition at line 186 of file db.h.


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