GCBM
standgrowthcurvefactory.h
Go to the documentation of this file.
1 #ifndef MOJA_MODULES_CBM_MOSSPARAMETERS_H_
2 #define MOJA_MODULES_CBM_MOSSPARAMETERS_H_
3 
4 #include "moja/modules/cbm/_modules.cbm_exports.h"
5 #include "moja/flint/modulebase.h"
7 
8 #include <Poco/LRUCache.h>
9 
10 namespace moja {
11 namespace modules {
12 namespace cbm {
13 
14  class CBM_API StandGrowthCurveFactory {
15 
16  public:
18  virtual ~StandGrowthCurveFactory() = default;
19 
20  Poco::SharedPtr<StandGrowthCurve> createStandGrowthCurve(Int64 standGrowthCurveID, Int64 spuID, flint::ILandUnitDataWrapper& landUnitData);
21  Poco::SharedPtr<StandGrowthCurve> getStandGrowthCurve(Int64 growthCurveID);
22 
23  private:
24  void addStandGrowthCurve(Int64 standGrowthCurveID, StandGrowthCurve& standGrowthCurve);
25 
26  // For each stand growth curve, the yield volume is not changed by SPU
27  // just create a thread safe lookup map by stand growth curve ID.
28  Poco::LRUCache<Int64, StandGrowthCurve>& getCache() {
29  thread_local Poco::LRUCache<Int64, StandGrowthCurve> cache;
30  return cache;
31  }
32  };
33 }}}
34 #endif
moja::modules::cbm
Definition: ageclasshelper.cpp:12
moja::modules::cbm::StandGrowthCurveFactory
Definition: standgrowthcurvefactory.h:14
moja::modules::cbm::StandGrowthCurveFactory::getCache
Poco::LRUCache< Int64, StandGrowthCurve > & getCache()
Definition: standgrowthcurvefactory.h:28
moja::modules::cbm::StandGrowthCurve
Definition: standgrowthcurve.h:16
standgrowthcurve.h
moja
Definition: ageclasshelper.cpp:10