GCBM
Public Member Functions | Private Member Functions | List of all members
StandGrowthCurveFactory Class Reference

#include <standgrowthcurvefactory.h>

Collaboration diagram for StandGrowthCurveFactory:
Collaboration graph

Public Member Functions

 StandGrowthCurveFactory ()
 
virtual ~StandGrowthCurveFactory ()=default
 
Poco::SharedPtr< StandGrowthCurvecreateStandGrowthCurve (Int64 standGrowthCurveID, Int64 spuID, flint::ILandUnitDataWrapper &landUnitData)
 
Poco::SharedPtr< StandGrowthCurvegetStandGrowthCurve (Int64 growthCurveID)
 

Private Member Functions

void addStandGrowthCurve (Int64 standGrowthCurveID, StandGrowthCurve &standGrowthCurve)
 
Poco::LRUCache< Int64, StandGrowthCurve > & getCache ()
 

Constructor & Destructor Documentation

◆ StandGrowthCurveFactory()

Constructor

◆ ~StandGrowthCurveFactory()

virtual ~StandGrowthCurveFactory ( )
virtualdefault

Member Function Documentation

◆ addStandGrowthCurve()

void addStandGrowthCurve ( Int64  standGrowthCurveID,
StandGrowthCurve standGrowthCurve 
)
private

Add the result of StandGrowthCurve.standGrowthCurveID() on parameter standGrowthCurve and parameter standGrowthCurve to the cache using StandGrowthCurveFactory.getCache()

Parameters
standGrowthCurveIDInt64
standGrowthCurveStandGrowthCurve&
Returns
void

◆ createStandGrowthCurve()

Poco::SharedPtr< StandGrowthCurve > createStandGrowthCurve ( Int64  standGrowthCurveID,
Int64  spuID,
flint::ILandUnitDataWrapper &  landUnitData 
)

Instantiate an object standGrowthCurve of StandGrowthCurve with parameters standGrowthCurveID, spuID
Get the softwoodYieldTable and hardwoodYieldTable from variables "softwood_yield_table", "hardwood_yield_table" in parameter landUnitData
Instantiate an object of TreeYieldTable with softwoodYieldTable, SpeciesType::Softwood and add it to standGrowthCurve
Instantiate an object of TreeYieldTable with hardwoodYieldTable, SpeciesType::Hardwood and add it to standGrowthCurve
For each row of variable "volume_to_biomass_parameters" in parameter landUnitData, query for the appropriate PERD factor data, based on the value of "forest_type" for each row either "Softwood" or "Hardwood", invoke StandGrowthCurve.setPERDFactor() and StandGrowthCurve.setForestTypeConfiguration()
Invoke StandGrowthCurveFactory.processStandYieldTables() to pre-process the stand growth curve, addStandGrowthCurve() with arguments standGrowthCurveID and standGrowthCurve and return the value of standGrowthCurveID in StandGrowthCurveFactory.getCache()

Parameters
standGrowthCurveIDInt64
spuIDInt64
landUnitDataflint::ILandUnitDataWrapper&
Returns
Poco::SharedPtr<StandGrowthCurve>

◆ getCache()

Poco::LRUCache<Int64, StandGrowthCurve>& getCache ( )
private

◆ getStandGrowthCurve()

Poco::SharedPtr< StandGrowthCurve > getStandGrowthCurve ( Int64  growthCurveID)

Return the value of paramter growthCurveID in StandGrowthCurveFactory.getCache() if not null, else return nullptr

Parameters
growthCurveID
Returns
Poco::SharedPtr<StandGrowthCurve>

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