FMT 1.2.0
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTYieldDevelopment.h
Go to the documentation of this file.
1/*
2Copyright (c) 2019 Gouvernement du Québec
3
4SPDX-License-Identifier: LiLiQ-R-1.1
5License-Filename: LICENSES/EN/LiLiQ-R11unicode.txt
6*/
7
8#ifndef FMTYIELDSDEVELOPMENT_Hm_included
9#define FMTYIELDSDEVELOPMENT_Hm_included
10
11#include <boost/unordered/concurrent_flat_map.hpp>
12#include <boost/dynamic_bitset.hpp>
13#include <string>
14
15
16namespace Core
17{
18 // DocString: FMTYieldDevelopment
23 {
24 public:
25 // DocString: FMTYieldDevelopment(int,int,const boost::dynamic_bitset<uint8_t>&,const std::string&)
33 FMTYieldDevelopment(int p_age, int p_period,
34 const boost::dynamic_bitset<uint8_t>& p_mask, const std::string& p_yield);
35 // DocString: FMTYieldDevelopment::operator==
41 bool operator == (const FMTYieldDevelopment& p_yieldDev) const;
42 // DocString: FMTYieldDevelopment::hash
47 size_t hash() const;
48 // DocString: FMTYieldDevelopment::getPeriod
53 int getPeriod() const;
54 private:
55 uint8_t m_age;
56 uint8_t m_period;
57 boost::dynamic_bitset<uint8_t> m_resumeMask;
58 std::string m_yield;
59 // DocString: FMTYieldDevelopment::_equalYield
66 bool _equalYield(const std::string& p_first, const std::string& p_second) const noexcept;
67 };
68}
69namespace boost {
70 template <>
71 struct hash< Core::FMTYieldDevelopment>
72 {
73 std::size_t operator()(const Core::FMTYieldDevelopment& p_yield) const
74 {
75 return (p_yield.hash());
76 }
77 };
78}
79#endif // FMTDATA_Hm_included
Development keyed by age, period, mask and yield, used to cache yield values.
Definition: FMTYieldDevelopment.h:23
size_t hash() const
Return the hash of the yield development.
int getPeriod() const
Return the period of the yield development.
bool operator==(const FMTYieldDevelopment &p_yieldDev) const
Equality comparison operator of FMTYieldDevelopment.
FMTYieldDevelopment(int p_age, int p_period, const boost::dynamic_bitset< uint8_t > &p_mask, const std::string &p_yield)
Construct a yield development from an age, a period, a mask and a yield.
The Core namespace provides classes for simulating stands/strata growth/harvest through time.
Definition: FMTAction.h:34
Definition: FMTAction.h:463
std::size_t operator()(const Core::FMTYieldDevelopment &p_yield) const
Definition: FMTYieldDevelopment.h:73