CatapultServer  v0.5.0.1 (Elephant)
catapult::cache::BasicBlockDifficultyCacheDelta Class Reference

Basic delta on top of the block difficulty cache. More...

Inheritance diagram for catapult::cache::BasicBlockDifficultyCacheDelta:
Collaboration diagram for catapult::cache::BasicBlockDifficultyCacheDelta:

Public Types

using ReadOnlyView = BlockDifficultyCacheTypes::CacheReadOnlyType
 
using ValueType = BlockDifficultyCacheDescriptor::ValueType
 
using IterableView = IterationMixin< BlockDifficultyCacheTypes::PrimaryTypes::BaseSetDeltaType >::IterableView
 

Public Member Functions

 BasicBlockDifficultyCacheDelta (const BlockDifficultyCacheTypes::BaseSetDeltaPointers &difficultyInfoSets, const BlockDifficultyCacheTypes::Options &options)
 Creates a delta around difficultyInfoSets and options. More...
 
deltaset::PruningBoundary< ValueTypepruningBoundary () const
 Gets the pruning boundary that is used during commit. More...
 
std::unique_ptr< IterableViewtryMakeIterableView () const
 
void insert (const ValueType &info)
 Inserts a block difficulty info into the set. More...
 
void insert (Height height, Timestamp timestamp, Difficulty difficulty)
 Inserts a block difficulty info into the set given a height and a timestamp and a difficulty. More...
 
void remove (const ValueType &info)
 Removes a block difficulty info from the set. More...
 
void remove (Height height)
 Removes a block difficulty info from the set given a height. More...
 
void prune (Height height)
 
- Public Member Functions inherited from catapult::utils::MoveOnly
constexpr MoveOnly ()=default
 Default constructor. More...
 
 ~MoveOnly ()=default
 Default destructor. More...
 
 MoveOnly (const NonCopyable &)=delete
 Disabled copy constructor. More...
 
 MoveOnly (MoveOnly &&)=default
 Default move constructor. More...
 
MoveOnlyoperator= (const MoveOnly &)=delete
 Disabled assignment operator. More...
 
MoveOnlyoperator= (MoveOnly &&)=default
 Default move assignment operator. More...
 
- Public Member Functions inherited from catapult::cache::SizeMixin< TSet >
 SizeMixin (const TSet &set)
 Creates a mixin around set. More...
 
size_t size () const
 Gets the number of elements in the cache. More...
 
- Public Member Functions inherited from catapult::cache::ContainsMixin< TSet, TCacheDescriptor >
 ContainsMixin (const TSet &set)
 Creates a mixin around set. More...
 
bool contains (const KeyType &key) const
 Gets a value indicating whether or not the cache contains an element with key. More...
 
- Public Member Functions inherited from catapult::deltaset::DeltaElementsMixin< TSetDelta >
 DeltaElementsMixin (const TSetDelta &setDelta)
 Creates a mixin around setDelta. More...
 
PointerContainer addedElements () const
 Gets pointers to all added elements. More...
 
PointerContainer modifiedElements () const
 Gets pointers to all modified elements. More...
 
PointerContainer removedElements () const
 Gets pointers to all removed elements. More...
 

Private Member Functions

void checkInsert (Height height)
 
void checkRemove (Height height) const
 
Height nextHeight () const
 

Private Attributes

BlockDifficultyCacheTypes::PrimaryTypes::BaseSetDeltaPointerType m_pOrderedDelta
 
uint64_t m_difficultyHistorySize
 
Height m_startHeight
 
deltaset::PruningBoundary< ValueTypem_pruningBoundary
 

Detailed Description

Basic delta on top of the block difficulty cache.

Member Typedef Documentation

◆ IterableView

◆ ReadOnlyView

◆ ValueType

Constructor & Destructor Documentation

◆ BasicBlockDifficultyCacheDelta()

catapult::cache::BasicBlockDifficultyCacheDelta::BasicBlockDifficultyCacheDelta ( const BlockDifficultyCacheTypes::BaseSetDeltaPointers &  difficultyInfoSets,
const BlockDifficultyCacheTypes::Options options 
)
explicit

Creates a delta around difficultyInfoSets and options.

Member Function Documentation

◆ checkInsert()

void catapult::cache::BasicBlockDifficultyCacheDelta::checkInsert ( Height  height)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkRemove()

void catapult::cache::BasicBlockDifficultyCacheDelta::checkRemove ( Height  height) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ insert() [1/2]

void catapult::cache::BasicBlockDifficultyCacheDelta::insert ( const ValueType info)

Inserts a block difficulty info into the set.

Here is the call graph for this function:

◆ insert() [2/2]

void catapult::cache::BasicBlockDifficultyCacheDelta::insert ( Height  height,
Timestamp  timestamp,
Difficulty  difficulty 
)

Inserts a block difficulty info into the set given a height and a timestamp and a difficulty.

Here is the call graph for this function:

◆ nextHeight()

Height catapult::cache::BasicBlockDifficultyCacheDelta::nextHeight ( ) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ prune()

void catapult::cache::BasicBlockDifficultyCacheDelta::prune ( Height  height)

Removes all block difficulty infos that have a height less than the given height minus a constant (constant = rewrite limit + 60).

◆ pruningBoundary()

deltaset::PruningBoundary< BasicBlockDifficultyCacheDelta::ValueType > catapult::cache::BasicBlockDifficultyCacheDelta::pruningBoundary ( ) const

Gets the pruning boundary that is used during commit.

◆ remove() [1/2]

void catapult::cache::BasicBlockDifficultyCacheDelta::remove ( const ValueType info)

Removes a block difficulty info from the set.

Here is the call graph for this function:

◆ remove() [2/2]

void catapult::cache::BasicBlockDifficultyCacheDelta::remove ( Height  height)

Removes a block difficulty info from the set given a height.

Here is the call graph for this function:

◆ tryMakeIterableView()

std::unique_ptr< BasicBlockDifficultyCacheDelta::IterableView > catapult::cache::BasicBlockDifficultyCacheDelta::tryMakeIterableView ( ) const

Creates an iterable view of the cache.

Note
Match BlockDifficultyCacheDeltaMixins::Iteration signature but don't derive because

Member Data Documentation

◆ m_difficultyHistorySize

uint64_t catapult::cache::BasicBlockDifficultyCacheDelta::m_difficultyHistorySize
private

◆ m_pOrderedDelta

BlockDifficultyCacheTypes::PrimaryTypes::BaseSetDeltaPointerType catapult::cache::BasicBlockDifficultyCacheDelta::m_pOrderedDelta
private

◆ m_pruningBoundary

deltaset::PruningBoundary<ValueType> catapult::cache::BasicBlockDifficultyCacheDelta::m_pruningBoundary
private

◆ m_startHeight

Height catapult::cache::BasicBlockDifficultyCacheDelta::m_startHeight
private

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