PIVX Core  5.6.99
P2P Digital Currency
Classes | Public Member Functions | Protected Types | Static Protected Member Functions | Protected Attributes | Friends | List of all members
CDBTransaction< Parent, CommitTarget > Class Template Reference

#include <dbwrapper.h>

Classes

struct  DataStreamCmp
 
struct  ValueHolder
 
struct  ValueHolderImpl
 

Public Member Functions

 CDBTransaction (Parent &_parent, CommitTarget &_commitTarget, int _nVersion)
 
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, int nVersion)
 

Protected Attributes

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

Friends

class CDBTransactionIterator< CDBTransaction >
 

Detailed Description

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

Definition at line 532 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 581 of file dbwrapper.h.

◆ ValueHolderPtr

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

Definition at line 556 of file dbwrapper.h.

◆ WritesMap

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

Definition at line 580 of file dbwrapper.h.

Constructor & Destructor Documentation

◆ CDBTransaction()

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

Definition at line 588 of file dbwrapper.h.

Member Function Documentation

◆ Clear()

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

Definition at line 675 of file dbwrapper.h.

Here is the caller graph for this function:

◆ Commit()

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

Definition at line 682 of file dbwrapper.h.

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

◆ Erase() [1/2]

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

Definition at line 663 of file dbwrapper.h.

Here is the call graph for this function:

◆ Erase() [2/2]

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

Definition at line 658 of file dbwrapper.h.

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

◆ Exists() [1/2]

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

Definition at line 644 of file dbwrapper.h.

◆ Exists() [2/2]

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

Definition at line 639 of file dbwrapper.h.

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

◆ GetMemoryUsage()

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

Definition at line 698 of file dbwrapper.h.

Here is the caller graph for this function:

◆ IsClean()

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

Definition at line 693 of file dbwrapper.h.

Here is the caller graph for this function:

◆ KeyToDataStream()

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

Definition at line 572 of file dbwrapper.h.

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

◆ NewIterator()

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

Definition at line 712 of file dbwrapper.h.

◆ NewIteratorUniquePtr()

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

Definition at line 716 of file dbwrapper.h.

Here is the caller graph for this function:

◆ Read() [1/2]

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

Definition at line 619 of file dbwrapper.h.

◆ Read() [2/2]

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

Definition at line 613 of file dbwrapper.h.

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

◆ Write() [1/2]

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

Definition at line 597 of file dbwrapper.h.

Here is the call graph for this function:

◆ Write() [2/2]

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

Definition at line 591 of file dbwrapper.h.

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

Friends And Related Function Documentation

◆ CDBTransactionIterator< CDBTransaction >

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

Definition at line 515 of file dbwrapper.h.

Member Data Documentation

◆ commitTarget

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

Definition at line 537 of file dbwrapper.h.

◆ deletes

template<typename Parent , typename CommitTarget >
DeletesSet CDBTransaction< Parent, CommitTarget >::deletes
protected

Definition at line 584 of file dbwrapper.h.

◆ memoryUsage

template<typename Parent , typename CommitTarget >
ssize_t CDBTransaction< Parent, CommitTarget >::memoryUsage {0}
protected

Definition at line 538 of file dbwrapper.h.

◆ nVersion

template<typename Parent , typename CommitTarget >
int CDBTransaction< Parent, CommitTarget >::nVersion
protected

Definition at line 585 of file dbwrapper.h.

◆ parent

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

Definition at line 536 of file dbwrapper.h.

◆ writes

template<typename Parent , typename CommitTarget >
WritesMap CDBTransaction< Parent, CommitTarget >::writes
protected

Definition at line 583 of file dbwrapper.h.


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