Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
CDBWrapper Class Reference

#include <dbwrapper.h>

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

Public Member Functions

 CDBWrapper (const DBParams &params)
 ~CDBWrapper ()
 CDBWrapper (const CDBWrapper &)=delete
CDBWrapperoperator= (const CDBWrapper &)=delete
template<typename K, typename V>
bool Read (const K &key, V &value) const
template<typename K, typename V>
void Write (const K &key, const V &value, bool fSync=false)
template<typename K>
bool Exists (const K &key) const
template<typename K>
void Erase (const K &key, bool fSync=false)
void WriteBatch (CDBBatch &batch, bool fSync=false)
size_t DynamicMemoryUsage () const
CDBIteratorNewIterator ()
bool IsEmpty ()
 Return true if the database managed by this class contains no entries.
template<typename K>
size_t EstimateSize (const K &key_begin, const K &key_end) const

Private Member Functions

std::optional< std::string > ReadImpl (std::span< const std::byte > key) const
bool ExistsImpl (std::span< const std::byte > key) const
size_t EstimateSizeImpl (std::span< const std::byte > key1, std::span< const std::byte > key2) const
auto & DBContext () const LIFETIMEBOUND

Private Attributes

std::unique_ptr< LevelDBContextm_db_context
 holds all leveldb-specific fields of this class
std::string m_name
 the name of this database
Obfuscation m_obfuscation
 optional XOR-obfuscation of the database

Static Private Attributes

static const std::string OBFUSCATION_KEY {"\000obfuscate_key", 14}
 obfuscation key storage key, null-prefixed to avoid collisions

Friends

const Obfuscationdbwrapper_private::GetObfuscation (const CDBWrapper &)

Detailed Description

Definition at line 178 of file dbwrapper.h.

Constructor & Destructor Documentation

◆ CDBWrapper() [1/2]

CDBWrapper::CDBWrapper ( const DBParams & params)

Definition at line 217 of file dbwrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~CDBWrapper()

CDBWrapper::~CDBWrapper ( )

Definition at line 264 of file dbwrapper.cpp.

Here is the call graph for this function:

◆ CDBWrapper() [2/2]

CDBWrapper::CDBWrapper ( const CDBWrapper & )
delete
Here is the call graph for this function:

Member Function Documentation

◆ DBContext()

auto & CDBWrapper::DBContext ( ) const
inlineprivate

Definition at line 197 of file dbwrapper.h.

Here is the caller graph for this function:

◆ DynamicMemoryUsage()

size_t CDBWrapper::DynamicMemoryUsage ( ) const

Definition at line 294 of file dbwrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Erase()

template<typename K>
void CDBWrapper::Erase ( const K & key,
bool fSync = false )
inline

Definition at line 244 of file dbwrapper.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EstimateSize()

template<typename K>
size_t CDBWrapper::EstimateSize ( const K & key_begin,
const K & key_end ) const
inline

Definition at line 264 of file dbwrapper.h.

Here is the call graph for this function:

◆ EstimateSizeImpl()

size_t CDBWrapper::EstimateSizeImpl ( std::span< const std::byte > key1,
std::span< const std::byte > key2 ) const
private

Definition at line 334 of file dbwrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Exists()

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

Definition at line 235 of file dbwrapper.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ExistsImpl()

bool CDBWrapper::ExistsImpl ( std::span< const std::byte > key) const
private

Definition at line 319 of file dbwrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsEmpty()

bool CDBWrapper::IsEmpty ( )

Return true if the database managed by this class contains no entries.

Definition at line 344 of file dbwrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NewIterator()

CDBIterator * CDBWrapper::NewIterator ( )

Definition at line 360 of file dbwrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

CDBWrapper & CDBWrapper::operator= ( const CDBWrapper & )
delete
Here is the call graph for this function:

◆ Read()

template<typename K, typename V>
bool CDBWrapper::Read ( const K & key,
V & value ) const
inline

Definition at line 207 of file dbwrapper.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadImpl()

std::optional< std::string > CDBWrapper::ReadImpl ( std::span< const std::byte > key) const
private

Definition at line 305 of file dbwrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Write()

template<typename K, typename V>
void CDBWrapper::Write ( const K & key,
const V & value,
bool fSync = false )
inline

Definition at line 227 of file dbwrapper.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteBatch()

void CDBWrapper::WriteBatch ( CDBBatch & batch,
bool fSync = false )

Definition at line 278 of file dbwrapper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dbwrapper_private::GetObfuscation

Member Data Documentation

◆ m_db_context

std::unique_ptr<LevelDBContext> CDBWrapper::m_db_context
private

holds all leveldb-specific fields of this class

Definition at line 183 of file dbwrapper.h.

◆ m_name

std::string CDBWrapper::m_name
private

the name of this database

Definition at line 186 of file dbwrapper.h.

◆ m_obfuscation

Obfuscation CDBWrapper::m_obfuscation
private

optional XOR-obfuscation of the database

Definition at line 189 of file dbwrapper.h.

◆ OBFUSCATION_KEY

const std::string CDBWrapper::OBFUSCATION_KEY {"\000obfuscate_key", 14}
inlinestaticprivate

obfuscation key storage key, null-prefixed to avoid collisions

Definition at line 192 of file dbwrapper.h.


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