Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

CDBTransaction< Parent, CommitTarget > Class Template Reference

#include <dbwrapper.h>

Classes

struct  DataStreamCmp
 
struct  ValueHolder
 
struct  ValueHolderImpl
 

Public Member Functions

 CDBTransaction (Parent &_parent, CommitTarget &_commitTarget)
 
template<typename K , typename V >
void Write (const K &key, const V &v)
 
template<typename V >
void Write (const CDataStream &ssKey, const V &v)
 
template<typename K , typename V >
bool Read (const K &key, V &value)
 
template<typename V >
bool Read (const CDataStream &ssKey, V &value)
 
template<typename K >
bool Exists (const K &key)
 
bool Exists (const CDataStream &ssKey)
 
template<typename K >
void Erase (const K &key)
 
void Erase (const CDataStream &ssKey)
 
void Clear ()
 
void Commit ()
 
bool IsClean ()
 
size_t GetMemoryUsage () const
 
CDBTransactionIterator< CDBTransaction > * NewIterator ()
 
std::unique_ptr< CDBTransactionIterator< CDBTransaction > > NewIteratorUniquePtr ()
 

Protected Types

typedef std::unique_ptr< ValueHolderValueHolderPtr
 
typedef std::map< CDataStream, ValueHolderPtr, DataStreamCmpWritesMap
 
typedef std::set< CDataStream, DataStreamCmpDeletesSet
 

Static Protected Member Functions

template<typename K >
static CDataStream KeyToDataStream (const K &key)
 

Protected Attributes

Parent & parent
 
CommitTarget & commitTarget
 
ssize_t memoryUsage {0}
 
WritesMap writes
 
DeletesSet deletes
 

Friends

class CDBTransactionIterator< CDBTransaction >
 

Detailed Description

template<typename Parent, typename CommitTarget>
class CDBTransaction< Parent, CommitTarget >

Definition at line 552 of file dbwrapper.h.

Member Typedef Documentation

◆ DeletesSet

template<typename Parent, typename CommitTarget>
typedef std::set<CDataStream, DataStreamCmp> CDBTransaction< Parent, CommitTarget >::DeletesSet
protected

Definition at line 600 of file dbwrapper.h.

◆ ValueHolderPtr

template<typename Parent, typename CommitTarget>
typedef std::unique_ptr<ValueHolder> CDBTransaction< Parent, CommitTarget >::ValueHolderPtr
protected

Definition at line 577 of file dbwrapper.h.

◆ WritesMap

template<typename Parent, typename CommitTarget>
typedef std::map<CDataStream, ValueHolderPtr, DataStreamCmp> CDBTransaction< Parent, CommitTarget >::WritesMap
protected

Definition at line 599 of file dbwrapper.h.

Constructor & Destructor Documentation

◆ CDBTransaction()

template<typename Parent, typename CommitTarget>
CDBTransaction< Parent, CommitTarget >::CDBTransaction ( Parent &  _parent,
CommitTarget &  _commitTarget 
)
inline

Definition at line 606 of file dbwrapper.h.

Member Function Documentation

◆ Clear()

template<typename Parent, typename CommitTarget>
void CDBTransaction< Parent, CommitTarget >::Clear ( )
inline

◆ Commit()

template<typename Parent, typename CommitTarget>
void CDBTransaction< Parent, CommitTarget >::Commit ( )
inline

Definition at line 692 of file dbwrapper.h.

Referenced by CEvoDB::CommitCurTransaction(), and CEvoDB::CommitRootTransaction().

◆ Erase() [1/2]

template<typename Parent, typename CommitTarget>
template<typename K >
void CDBTransaction< Parent, CommitTarget >::Erase ( const K &  key)
inline

◆ Erase() [2/2]

template<typename Parent, typename CommitTarget>
void CDBTransaction< Parent, CommitTarget >::Erase ( const CDataStream ssKey)
inline

Definition at line 675 of file dbwrapper.h.

◆ Exists() [1/2]

template<typename Parent, typename CommitTarget>
template<typename K >
bool CDBTransaction< Parent, CommitTarget >::Exists ( const K &  key)
inline

◆ Exists() [2/2]

template<typename Parent, typename CommitTarget>
bool CDBTransaction< Parent, CommitTarget >::Exists ( const CDataStream ssKey)
inline

Definition at line 658 of file dbwrapper.h.

◆ GetMemoryUsage()

template<typename Parent, typename CommitTarget>
size_t CDBTransaction< Parent, CommitTarget >::GetMemoryUsage ( ) const
inline

Definition at line 706 of file dbwrapper.h.

Referenced by CEvoDB::GetMemoryUsage().

◆ IsClean()

template<typename Parent, typename CommitTarget>
bool CDBTransaction< Parent, CommitTarget >::IsClean ( )
inline

Definition at line 702 of file dbwrapper.h.

Referenced by CEvoDB::CommitRootTransaction().

◆ KeyToDataStream()

template<typename Parent, typename CommitTarget>
template<typename K >
static CDataStream CDBTransaction< Parent, CommitTarget >::KeyToDataStream ( const K &  key)
inlinestaticprotected

◆ NewIterator()

template<typename Parent, typename CommitTarget>
CDBTransactionIterator<CDBTransaction>* CDBTransaction< Parent, CommitTarget >::NewIterator ( )
inline

Definition at line 719 of file dbwrapper.h.

◆ NewIteratorUniquePtr()

template<typename Parent, typename CommitTarget>
std::unique_ptr<CDBTransactionIterator<CDBTransaction> > CDBTransaction< Parent, CommitTarget >::NewIteratorUniquePtr ( )
inline

◆ Read() [1/2]

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

◆ Read() [2/2]

template<typename Parent, typename CommitTarget>
template<typename V >
bool CDBTransaction< Parent, CommitTarget >::Read ( const CDataStream ssKey,
V &  value 
)
inline

Definition at line 635 of file dbwrapper.h.

◆ Write() [1/2]

template<typename Parent, typename CommitTarget>
template<typename K , typename V >
void CDBTransaction< Parent, CommitTarget >::Write ( const K &  key,
const V &  v 
)
inline

◆ Write() [2/2]

template<typename Parent, typename CommitTarget>
template<typename V >
void CDBTransaction< Parent, CommitTarget >::Write ( const CDataStream ssKey,
const V &  v 
)
inline

Definition at line 614 of file dbwrapper.h.

Friends And Related Function Documentation

◆ CDBTransactionIterator< CDBTransaction >

template<typename Parent, typename CommitTarget>
friend class CDBTransactionIterator< CDBTransaction >
friend

Definition at line 553 of file dbwrapper.h.

Member Data Documentation

◆ commitTarget

template<typename Parent, typename CommitTarget>
CommitTarget& CDBTransaction< Parent, CommitTarget >::commitTarget
protected

◆ deletes

◆ memoryUsage

◆ parent

template<typename Parent, typename CommitTarget>
Parent& CDBTransaction< Parent, CommitTarget >::parent
protected

◆ writes


The documentation for this class was generated from the following file:
Released under the MIT license