8#ifndef FMTYIELDSCACHE_Hm_included
9#define FMTYIELDSCACHE_Hm_included
12#include <boost/unordered/concurrent_flat_map.hpp>
13#include <boost/dynamic_bitset.hpp>
21 class FMTYieldDevelopment;
22 class FMTYieldRequest;
61 const std::string& p_yield)
const;
70 const std::string& p_yield)
const;
78 void set(
double p_value,
80 const std::string& p_yield);
88 static std::unique_ptr<boost::concurrent_flat_map<FMTYieldDevelopment,double>> m_cache;
97 const std::string& p_yield)
const;
102 void _clearIfTooBig();
Development keyed by age, period, mask and yield, used to cache yield values.
Definition: FMTYieldDevelopment.h:23
Request for yield values using a development and optionally a graph vertex.
Definition: FMTYieldRequest.h:37
Cache of yield values keyed by development and yield name.
Definition: FMTYieldsCache.h:28
void set(double p_value, const FMTYieldRequest &p_request, const std::string &p_yield)
Cache a value for a request and yield.
double get(const FMTYieldRequest &p_request, const std::string &p_yield) const
Get the cached value for a request and yield.
void reserve(const FMTYieldRequest &p_request)
Reserve memory in the cache for a request.
FMTYieldsCache(const FMTYieldsCache &rhs)=default
Copy constructor for FMTYieldsCache.
FMTYieldsCache()=default
Default constructor for FMTYieldsCache.
~FMTYieldsCache()=default
Default destructor for FMTYieldsCache.
FMTYieldsCache & operator=(const FMTYieldsCache &rhs)=default
Copy assignment operator for FMTYieldsCache.
bool inCache(const FMTYieldRequest &p_request, const std::string &p_yield) const
Return true if the value for a request and yield is cached.
The Core namespace provides classes for simulating stands/strata growth/harvest through time.
Definition: FMTAction.h:34