CatapultServer  v0.5.0.1 (Elephant)
catapult::chain::BlockHitPredicate Class Reference

Predicate used to determine if a block is a hit or not. More...

Collaboration diagram for catapult::chain::BlockHitPredicate:

Public Member Functions

 BlockHitPredicate (const model::BlockChainConfiguration &config, const ImportanceLookupFunc &importanceLookup)
 
bool operator() (const model::Block &parentBlock, const model::Block &block, const GenerationHash &generationHash) const
 Determines if the block is a hit given its parent (parentBlock) and generation hash (generationHash). More...
 
bool operator() (const BlockHitContext &context) const
 Determines if the specified context is a hit. More...
 

Private Types

using ImportanceLookupFunc = std::function< Importance(const Key &, Height)>
 

Private Attributes

model::BlockChainConfiguration m_config
 
ImportanceLookupFunc m_importanceLookup
 

Detailed Description

Predicate used to determine if a block is a hit or not.

Member Typedef Documentation

◆ ImportanceLookupFunc

Constructor & Destructor Documentation

◆ BlockHitPredicate()

catapult::chain::BlockHitPredicate::BlockHitPredicate ( const model::BlockChainConfiguration config,
const ImportanceLookupFunc importanceLookup 
)

Creates a predicate around a block chain configuration (config) and an importance lookup function (importanceLookup).

Member Function Documentation

◆ operator()() [1/2]

bool catapult::chain::BlockHitPredicate::operator() ( const BlockHitContext context) const

Determines if the specified context is a hit.

◆ operator()() [2/2]

bool catapult::chain::BlockHitPredicate::operator() ( const model::Block parentBlock,
const model::Block block,
const GenerationHash generationHash 
) const

Determines if the block is a hit given its parent (parentBlock) and generation hash (generationHash).

Member Data Documentation

◆ m_config

model::BlockChainConfiguration catapult::chain::BlockHitPredicate::m_config
private

◆ m_importanceLookup

ImportanceLookupFunc catapult::chain::BlockHitPredicate::m_importanceLookup
private

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