Fabcoin Core  0.16.2
P2P Digital Currency
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
CWalletDBWrapper Class Reference

An instance of this class represents one database. More...

#include <db.h>

Collaboration diagram for CWalletDBWrapper:
[legend]

Public Member Functions

 CWalletDBWrapper ()
 Create dummy DB handle. More...
 
 CWalletDBWrapper (CDBEnv *env_in, const std::string &strFile_in)
 Create DB handle to real database. More...
 
bool Rewrite (const char *pszSkip=nullptr)
 Rewrite the entire database on disk, with the exception of key pszSkip if non-zero. More...
 
bool Backup (const std::string &strDest)
 Back up the entire database to a file. More...
 
std::string GetName () const
 Get a name for this database, for debugging etc. More...
 
void Flush (bool shutdown)
 Make sure all changes are flushed to disk. More...
 
void IncrementUpdateCounter ()
 

Public Attributes

std::atomic< unsigned int > nUpdateCounter
 
unsigned int nLastSeen
 
unsigned int nLastFlushed
 
int64_t nLastWalletUpdate
 

Private Member Functions

bool IsDummy ()
 Return whether this database handle is a dummy for testing. More...
 

Private Attributes

CDBEnvenv
 BerkeleyDB specific. More...
 
std::string strFile
 

Friends

class CDB
 

Detailed Description

An instance of this class represents one database.

For BerkeleyDB this is just a (env, strFile) tuple.

Definition at line 93 of file db.h.

Constructor & Destructor Documentation

CWalletDBWrapper::CWalletDBWrapper ( )
inline

Create dummy DB handle.

Definition at line 98 of file db.h.

CWalletDBWrapper::CWalletDBWrapper ( CDBEnv env_in,
const std::string &  strFile_in 
)
inline

Create DB handle to real database.

Definition at line 103 of file db.h.

Here is the call graph for this function:

Member Function Documentation

bool CWalletDBWrapper::Backup ( const std::string &  strDest)

Back up the entire database to a file.

Definition at line 686 of file db.cpp.

Here is the call graph for this function:

void CWalletDBWrapper::Flush ( bool  shutdown)

Make sure all changes are flushed to disk.

Definition at line 728 of file db.cpp.

Here is the call graph for this function:

std::string CWalletDBWrapper::GetName ( ) const
inline

Get a name for this database, for debugging etc.

Definition at line 118 of file db.h.

Here is the call graph for this function:

void CWalletDBWrapper::IncrementUpdateCounter ( )

Definition at line 470 of file db.cpp.

bool CWalletDBWrapper::IsDummy ( )
inlineprivate

Return whether this database handle is a dummy for testing.

Only to be used at a low level, application should ideally not care about this.

Definition at line 140 of file db.h.

Here is the caller graph for this function:

bool CWalletDBWrapper::Rewrite ( const char *  pszSkip = nullptr)

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

Definition at line 681 of file db.cpp.

Here is the call graph for this function:

Friends And Related Function Documentation

friend class CDB
friend

Definition at line 95 of file db.h.

Member Data Documentation

CDBEnv* CWalletDBWrapper::env
private

BerkeleyDB specific.

Definition at line 133 of file db.h.

unsigned int CWalletDBWrapper::nLastFlushed

Definition at line 128 of file db.h.

unsigned int CWalletDBWrapper::nLastSeen

Definition at line 127 of file db.h.

int64_t CWalletDBWrapper::nLastWalletUpdate

Definition at line 129 of file db.h.

std::atomic<unsigned int> CWalletDBWrapper::nUpdateCounter

Definition at line 126 of file db.h.

std::string CWalletDBWrapper::strFile
private

Definition at line 134 of file db.h.


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