FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTyieldparser.hpp
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 FMTyieldparser_H_INCLUDED
9#define FMTyieldparser_H_INCLUDED
10
11#include "FMTparser.hpp"
12#include "FMTutility.hpp"
13#include <iterator>
14#include <boost/regex.hpp>
15#include <string>
16#include <vector>
17#include <utility>
18#include <memory>
19
20namespace Core
21{
22 class FMTyields;
23 class FMTconstants;
24 class FMTtheme;
25 class FMTdata;
26 class FMTyieldmodel;
27 class FMTyieldhandler;
28 class FMTmask;
29}
30
31
32namespace Parser
33{
34// DocString: FMTyieldparser
40 {
41 private:
42 // DocString: FMTyieldparser::rxyieldtype
44 const static boost::regex rxyieldtype;
45 // DocString: FMTyieldparser::rxcomplex
47 const static boost::regex rxcomplex;
48 // DocString: FMTyieldparser::rxeqs
50 const static boost::regex rxeqs;
51 // DocString: FMTyieldparser::rxdiscount
53 const static boost::regex rxdiscount;
54 // DocString: FMTyieldparser::rxpredictor
56 const static boost::regex rxpredictor;
57 // DocString: FMTyieldparser::getyldtype
61 Core::FMTyldtype getyldtype(const std::string& value) const;
62 // DocString: FMTyieldparser::gethandler
66 std::unique_ptr<Core::FMTyieldhandler> gethandler(const Core::FMTmask& mask, const Core::FMTyldtype& yldtype) const;
67 // DocString: FMTyieldparser::getyldctype
71 Core::FMTyieldparserop getyldctype(const std::string& value) const;
72 // DocString: FMTyieldparser::getylduse
76 std::vector<std::string> getylduse(Core::FMTyields& yielddata,
77 std::vector<std::pair<Core::FMTmask,std::unique_ptr<Core::FMTyieldhandler>>>::iterator actualyield,
78 const std::vector<std::string>& values) const;
79 // DocString: FMTyieldparser::setoveridedylds
83 void setoveridedylds(Core::FMTyields& yielddata,
84 std::vector<std::pair<Core::FMTmask, std::unique_ptr<Core::FMTyieldhandler>>>::iterator actualyield,
85 const std::string& yld) const;
86 // DocString: FMTyieldparser::checkpreexisting
90 void checkpreexisting(const std::vector<std::string>& preexists) const;
91 // DocString: FMTyieldparser::isfunction
95 bool isfunction(const std::string& strfunction) const;
96 // DocString: FMTyieldparser::getnumwithproportion
101 double getnumwithproportion(const std::string& value,const Core::FMTconstants& constants,
102 const std::vector<double>& proportions, const int& location);
103 // DocString: FMTyieldparser::geteq
107 Core::FMTdata geteq(const std::string& basestr,
108 const Core::FMTconstants& constants,
109 const Core::FMTyields& ylds,
110 const std::vector<Core::FMTtheme>& themes);
111 // DocString: FMTyieldparser::cleanup
115 void cleanup(Core::FMTyields& yields, const std::vector<Core::FMTtheme>& themes, const Core::FMTconstants& constants) const;
116 // DocString: FMTyieldparser::getindexvalues
120 std::map<std::string, double>getindexvalues(const Core::FMTmask& mask,
121 const std::vector<Core::FMTtheme>& themes,
122 const std::vector<std::string>&indexvalues, const Core::FMTconstants& constants) const;
123 // DocString: FMTyieldparser::readyieldmodel
127 std::unique_ptr<Core::FMTyieldmodel>readyieldmodel(const std::string& modelname, std::vector<std::string>& modelYields,const Core::FMTmask& mainmask) const;
128 // DocString: FMTyieldparser::cleanall
132 void cleanall(Core::FMTyields& ylds, const std::vector<Core::FMTtheme>& themes, const Core::FMTconstants& constants) const;
133 public:
134 // DocString: FMTyieldparser()
139 // DocString: ~FMTyieldparser()
143 ~FMTyieldparser() = default;
144 // DocString: FMTyieldparser(const FMTyieldparser&)
148 FMTyieldparser(const FMTyieldparser& rhs)=default;
149 // DocString: FMTyieldparser::FMTyieldparser=
153 FMTyieldparser& operator = (const FMTyieldparser& rhs)=default;
154 // DocString: FMTyieldparser::read
158 Core::FMTyields read(const std::vector<Core::FMTtheme>& themes,const Core::FMTconstants& constants,const std::string& location);
159 // DocString: FMTyieldparser::write
163 void write(const Core::FMTyields& yields,const std::string& location) const;
164 };
165}
166#endif // FMTyieldparser_H_INCLUDED
#define FMTEXPORT
Definition: FMTutility.hpp:92
Definition: FMTconstants.hpp:29
Definition: FMTdata.hpp:32
Definition: FMTmask.hpp:96
Definition: FMTyields.hpp:40
Definition: FMTparser.hpp:66
Definition: FMTyieldparser.hpp:40
void write(const Core::FMTyields &yields, const std::string &location) const
FMTyieldparser(const FMTyieldparser &rhs)=default
Core::FMTyields read(const std::vector< Core::FMTtheme > &themes, const Core::FMTconstants &constants, const std::string &location)
The Core namespace provides classes for simulating stands/strata growth/harvest through time.
Definition: FMTaction.hpp:31
FMTyldtype
Definition: FMTutility.hpp:45
FMTyieldparserop
Definition: FMTutility.hpp:53
Namespace handling all FMT's parsers. Everything related to I/O should be located in this namespace.
Definition: FMTactionparser.hpp:26