CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
26 namespace catapult {
namespace cache {
29 template<
typename TTree>
45 ? std::make_pair(
m_pTree->root(),
true)
46 : std::make_pair(
Hash256(),
false);
50 std::pair<Hash256, bool>
tryLookup(
const typename TTree::KeyType& key, std::vector<tree::TreeNode>& nodePath)
const {
52 ?
m_pTree->lookup(key, nodePath)
53 : std::make_pair(
Hash256(),
false);
61 template<
typename TSet,
typename TTree>
80 ? std::make_pair(
m_pTree->root(),
true)
81 : std::make_pair(
Hash256(),
false);
105 m_set.incrementGenerationId();
PatriciaTreeMixin(const TTree *pTree)
Creates a mixin around pTree.
Definition: PatriciaTreeCacheMixins.h:33
utils::ByteArray< Hash256_Size, Hash256_tag > Hash256
Definition: src/catapult/types.h:47
bool supportsMerkleRoot() const
Returns true if merkle root is supported.
Definition: PatriciaTreeCacheMixins.h:38
A mixin for adding patricia tree support to a cache.
Definition: PatriciaTreeCacheMixins.h:30
#define CATAPULT_THROW_RUNTIME_ERROR_1(MESSAGE, PARAM1)
Macro used to throw a catapult runtime error with a single parameter.
Definition: exceptions.h:171
PatriciaTreeDeltaMixin(TSet &set, const std::shared_ptr< TTree > &pTree)
Creates a mixin around delta set and pTree.
Definition: PatriciaTreeCacheMixins.h:65
bool supportsMerkleRoot() const
Returns true if merkle root is supported.
Definition: PatriciaTreeCacheMixins.h:73
std::pair< Hash256, bool > tryLookup(const typename TTree::KeyType &key, std::vector< tree::TreeNode > &nodePath) const
Tries to find the value associated with key in the tree and stores proof of existence or not in nodeP...
Definition: PatriciaTreeCacheMixins.h:50
std::shared_ptr< TTree > m_pTree
Definition: PatriciaTreeCacheMixins.h:112
uint32_t m_nextGenerationId
Definition: PatriciaTreeCacheMixins.h:113
A mixin for adding patricia tree support to a delta cache.
Definition: PatriciaTreeCacheMixins.h:62
void updateMerkleRoot(Height height)
Recalculates the merkle root given the specified chain height if supported.
Definition: PatriciaTreeCacheMixins.h:85
Definition: AddressExtractionExtension.cpp:28
TSet & m_set
Definition: PatriciaTreeCacheMixins.h:111
void setApplyCheckpoint()
Definition: PatriciaTreeCacheMixins.h:104
std::pair< Hash256, bool > tryGetMerkleRoot() const
Tries to get the merkle root if supported.
Definition: PatriciaTreeCacheMixins.h:43
void ApplyDeltasToTree(TTree &tree, const TSet &set, uint32_t minGenerationId, Height height)
Definition: PatriciaTreeUtils.h:71
void setMerkleRoot(const Hash256 &merkleRoot)
Definition: PatriciaTreeCacheMixins.h:95
const TTree * m_pTree
Definition: PatriciaTreeCacheMixins.h:57
std::pair< Hash256, bool > tryGetMerkleRoot() const
Tries to get the merkle root if supported.
Definition: PatriciaTreeCacheMixins.h:78