CatapultServer
v0.5.0.1 (Elephant)
|
Predicate used to determine if a block is a hit or not. More...
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 |
Predicate used to determine if a block is a hit or not.
|
private |
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).
bool catapult::chain::BlockHitPredicate::operator() | ( | const BlockHitContext & | context | ) | const |
Determines if the specified context is a hit.
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).
|
private |
|
private |