FMT 1.2.0
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTOutputParser.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 FMToutputparser_Hm_included
9#define FMToutputparser_Hm_included
10
11#include "FMTParser.h"
12#include "FMTutility.h"
13#include <boost/regex.hpp>
14#include <string>
15
16namespace Core
17{
18 class FMTTheme;
19 class FMTAction;
20 class FMTYields;
21 class FMTConstants;
22 class FMTOutput;
23 class FMTOutputSource;
24 class FMTOperator;
25}
26
27namespace Parser
28
29{
30// DocString: FMTOutputParser
35 {
36 public:
37 // DocString: FMTOutputParser()
42 // DocString: ~FMTOutputParser()
46 ~FMTOutputParser() = default;
47 // DocString: FMTOutputParser(const FMTOutputParser&)
52 FMTOutputParser(const FMTOutputParser& rhs)=default;
53 // DocString: FMTOutputParser::operator=
59 FMTOutputParser& operator = (const FMTOutputParser& rhs)=default;
60 // DocString: FMTOutputParser::read
70 std::vector<Core::FMTOutput> read(const std::vector<Core::FMTTheme>& themes,
71 const std::vector<Core::FMTAction>& actions,
72 const Core::FMTYields& ylds,const Core::FMTConstants& constants,
73 const std::string& location);
74 // DocString: FMTOutputParser::addOutputs
86 std::vector<Core::FMTOutput> addOutputs(const std::vector<Core::FMTOutput> oldoutputs,
87 const std::vector<Core::FMTTheme>& themes,
88 const std::vector<Core::FMTAction>& actions,
89 const Core::FMTYields& ylds,const Core::FMTConstants& constants,
90 const std::string& location,
91 std::vector<std::string> outputsnames = std::vector<std::string>());
92 // DocString: FMTOutputParser::write
98 void write(const std::vector<Core::FMTOutput>& outputs,const std::string& location) const;
99 private:
100 // DocString: FMTOutputParser::m_rxoutput
102 const static boost::regex m_rxoutput;
103 // DocString: FMTOutputParser::m_rxsource
105 const static boost::regex m_rxsource;
106 // DocString: FMTOutputParser::m_rxtar
108 const static boost::regex m_rxtar;
109 // DocString: FMTOutputParser::m_rxgrp
111 const static boost::regex m_rxgrp;
112 // DocString: FMTOutputParser::m_rxoutputconstant
114 const static boost::regex m_rxoutputconstant;
115 // DocString: FMTOutputParser::_readNFill
125 void _readNFill(std::vector<Core::FMTOutput>* outputs,
126 const std::vector<Core::FMTTheme>& themes,
127 const std::vector<Core::FMTAction>& actions,
128 const Core::FMTYields& ylds,const Core::FMTConstants& constants,
129 const std::string& location);
130 // DocString: FMTOutputParser::_appendToOutput
142 void _appendToOutput(
143 const std::string& strvalue,
144 const int& outputid,
145 const int& themetarget,
146 const size_t& lastoutput,
147 std::string& lastoperator,
148 std::vector<std::string>& stroperators,
149 std::vector<Core::FMTOutputSource>& sources,
150 std::vector<Core::FMTOperator>& operators) const;
151
152 };
153
154}
155
156
157#endif // FMToutputparser_Hm_included
#define FMTEXPORT
Definition: FMTutility.h:125
Class holding the constants defined in the constants section of a model, used by the parsers.
Definition: FMTConstants.h:28
FMTList containing multiple yield handlers as seen in the yield section, holding the information rela...
Definition: FMTYields.h:44
Parser reading and writing a vector of FMTOutput from or into a file.
Definition: FMTOutputParser.h:35
std::vector< Core::FMTOutput > addOutputs(const std::vector< Core::FMTOutput > oldoutputs, const std::vector< Core::FMTTheme > &themes, const std::vector< Core::FMTAction > &actions, const Core::FMTYields &ylds, const Core::FMTConstants &constants, const std::string &location, std::vector< std::string > outputsnames=std::vector< std::string >())
Read an output file and add the desired outputs to a vector of outputs.
~FMTOutputParser()=default
Default destructor for FMTOutputParser.
FMTOutputParser(const FMTOutputParser &rhs)=default
Copy constructor for FMTOutputParser.
std::vector< Core::FMTOutput > read(const std::vector< Core::FMTTheme > &themes, const std::vector< Core::FMTAction > &actions, const Core::FMTYields &ylds, const Core::FMTConstants &constants, const std::string &location)
Read an output file.
FMTOutputParser()
Default constructor for FMTOutputParser.
void write(const std::vector< Core::FMTOutput > &outputs, const std::string &location) const
Write a vector of outputs to a file.
Main parent class of all the parsers in FMT.
Definition: FMTParser.h:72
The Core namespace provides classes for simulating stands/strata growth/harvest through time.
Definition: FMTAction.h:34
Namespace handling all FMT's parsers. Everything related to I/O should be located in this namespace.
Definition: FMTActionParser.h:27