CatapultServer  v0.5.0.1 (Elephant)
catapult::model::InflationCalculator Class Reference

Calculator for calculating the inflation at a given height and the total inflation up to a given height. More...

Public Member Functions

size_t size () const
 Gets the number of inflation entries. More...
 
bool contains (Height height, Amount amount) const
 Returns true if the inflation map contains entry with height and amount. More...
 
Amount getSpotAmount (Height height) const
 Gets the inflation amount at height. More...
 
Amount getCumulativeAmount (Height height) const
 Gets the total inflation amount up to (but not including) height. More...
 
std::pair< Amount, bool > sumAll () const
 Calculates the total inflation. More...
 
void add (Height height, Amount amount)
 Adds inflation of amount starting at height. More...
 

Private Attributes

std::map< Height, Amountm_inflationMap
 

Detailed Description

Calculator for calculating the inflation at a given height and the total inflation up to a given height.

Member Function Documentation

◆ add()

void catapult::model::InflationCalculator::add ( Height  height,
Amount  amount 
)

Adds inflation of amount starting at height.

Here is the caller graph for this function:

◆ contains()

bool catapult::model::InflationCalculator::contains ( Height  height,
Amount  amount 
) const

Returns true if the inflation map contains entry with height and amount.

◆ getCumulativeAmount()

Amount catapult::model::InflationCalculator::getCumulativeAmount ( Height  height) const

Gets the total inflation amount up to (but not including) height.

Here is the call graph for this function:

◆ getSpotAmount()

Amount catapult::model::InflationCalculator::getSpotAmount ( Height  height) const

Gets the inflation amount at height.

◆ size()

size_t catapult::model::InflationCalculator::size ( ) const

Gets the number of inflation entries.

Here is the caller graph for this function:

◆ sumAll()

std::pair< Amount, bool > catapult::model::InflationCalculator::sumAll ( ) const

Calculates the total inflation.

Member Data Documentation

◆ m_inflationMap

std::map<Height, Amount> catapult::model::InflationCalculator::m_inflationMap
private

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