CatapultServer  v0.5.0.1 (Elephant)
catapult::cache::PatriciaTreeDeltaMixin< TSet, TTree > Class Template Reference

A mixin for adding patricia tree support to a delta cache. More...

Inheritance diagram for catapult::cache::PatriciaTreeDeltaMixin< TSet, TTree >:

Public Member Functions

 PatriciaTreeDeltaMixin (TSet &set, const std::shared_ptr< TTree > &pTree)
 Creates a mixin around delta set and pTree. More...
 
bool supportsMerkleRoot () const
 Returns true if merkle root is supported. More...
 
std::pair< Hash256, bool > tryGetMerkleRoot () const
 Tries to get the merkle root if supported. More...
 
void updateMerkleRoot (Height height)
 Recalculates the merkle root given the specified chain height if supported. More...
 
void setMerkleRoot (const Hash256 &merkleRoot)
 

Private Member Functions

void setApplyCheckpoint ()
 

Private Attributes

TSet & m_set
 
std::shared_ptr< TTree > m_pTree
 
uint32_t m_nextGenerationId
 

Detailed Description

template<typename TSet, typename TTree>
class catapult::cache::PatriciaTreeDeltaMixin< TSet, TTree >

A mixin for adding patricia tree support to a delta cache.

Constructor & Destructor Documentation

◆ PatriciaTreeDeltaMixin()

template<typename TSet , typename TTree >
catapult::cache::PatriciaTreeDeltaMixin< TSet, TTree >::PatriciaTreeDeltaMixin ( TSet &  set,
const std::shared_ptr< TTree > &  pTree 
)
inline

Creates a mixin around delta set and pTree.

Member Function Documentation

◆ setApplyCheckpoint()

template<typename TSet , typename TTree >
void catapult::cache::PatriciaTreeDeltaMixin< TSet, TTree >::setApplyCheckpoint ( )
inlineprivate
Here is the caller graph for this function:

◆ setMerkleRoot()

template<typename TSet , typename TTree >
void catapult::cache::PatriciaTreeDeltaMixin< TSet, TTree >::setMerkleRoot ( const Hash256 merkleRoot)
inline

Sets the merkle root (merkleRoot) if supported.

Note
There must not be any pending changes.
Here is the call graph for this function:

◆ supportsMerkleRoot()

template<typename TSet , typename TTree >
bool catapult::cache::PatriciaTreeDeltaMixin< TSet, TTree >::supportsMerkleRoot ( ) const
inline

Returns true if merkle root is supported.

◆ tryGetMerkleRoot()

template<typename TSet , typename TTree >
std::pair<Hash256, bool> catapult::cache::PatriciaTreeDeltaMixin< TSet, TTree >::tryGetMerkleRoot ( ) const
inline

Tries to get the merkle root if supported.

◆ updateMerkleRoot()

template<typename TSet , typename TTree >
void catapult::cache::PatriciaTreeDeltaMixin< TSet, TTree >::updateMerkleRoot ( Height  height)
inline

Recalculates the merkle root given the specified chain height if supported.

Here is the call graph for this function:

Member Data Documentation

◆ m_nextGenerationId

template<typename TSet , typename TTree >
uint32_t catapult::cache::PatriciaTreeDeltaMixin< TSet, TTree >::m_nextGenerationId
private

◆ m_pTree

template<typename TSet , typename TTree >
std::shared_ptr<TTree> catapult::cache::PatriciaTreeDeltaMixin< TSet, TTree >::m_pTree
private

◆ m_set

template<typename TSet , typename TTree >
TSet& catapult::cache::PatriciaTreeDeltaMixin< TSet, TTree >::m_set
private

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