FMT 1.2.0
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTScheduleParser.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 FMTscheduleparser_Hm_included
9#define FMTscheduleparser_Hm_included
10
11#include "FMTParser.h"
12#include "FMTutility.h"
13#include <vector>
14#include <string>
15
16namespace Core {
17 class FMTTheme;
18 class FMTAction;
19 class FMTSchedule;
20}
21
22namespace Parser
23{
24// DocString: FMTScheduleParser
29 {
30 public:
31 // DocString: FMTScheduleParser()
36 // DocString: ~FMTScheduleParser()
40 ~FMTScheduleParser() = default;
41 // DocString: FMTScheduleParser(const FMTScheduleParser&)
47 // DocString: FMTScheduleParser::getSchedulePath
54 std::string getSchedulePath(const std::string& p_primary_path, const std::string& p_output_scenario_name);
55 // DocString: FMTScheduleParser::operator=
61 FMTScheduleParser& operator = (const FMTScheduleParser& rhs);
62 // DocString: FMTScheduleParser::read
71 std::vector<Core::FMTSchedule>read(const std::vector<Core::FMTTheme>& themes,
72 const std::vector<Core::FMTAction>& actions,const std::string& location,double tolerance = FMT_DBL_TOLERANCE);
73 // DocString: FMTScheduleParser::write
80 void write(const std::vector<Core::FMTSchedule>& schedules, const std::string& location, bool append = false) const;
81
82 private:
83 // DocString: FMTScheduleParser::getVariable
88 int getVariable() const;
89 // DocString: FMTScheduleParser::
95 static void _writeSchedule(std::ofstream& p_stream, const std::vector<Core::FMTSchedule>& p_schedules);
96 // DocString: FMTScheduleParser::
102 static std::vector<Core::FMTSchedule>::const_iterator _getFirstEmptySchedule(const std::vector<Core::FMTSchedule>& p_schedules);
103
104 };
105}
106
107
108#endif // FMTscheduleparser_Hm_included
#define FMT_DBL_TOLERANCE
Definition: FMTutility.h:11
#define FMTEXPORT
Definition: FMTutility.h:125
Main parent class of all the parsers in FMT.
Definition: FMTParser.h:72
Parser reading and writing vectors of schedules, also used by the model parser.
Definition: FMTScheduleParser.h:29
void write(const std::vector< Core::FMTSchedule > &schedules, const std::string &location, bool append=false) const
Write a vector of schedules to a schedule file.
std::vector< Core::FMTSchedule > read(const std::vector< Core::FMTTheme > &themes, const std::vector< Core::FMTAction > &actions, const std::string &location, double tolerance=FMT_DBL_TOLERANCE)
Read a schedule section and turn it into a vector of schedules.
~FMTScheduleParser()=default
Default destructor for FMTScheduleParser.
FMTScheduleParser()
Default constructor for FMTScheduleParser.
FMTScheduleParser(const FMTScheduleParser &rhs)
Copy constructor for FMTScheduleParser.
std::string getSchedulePath(const std::string &p_primary_path, const std::string &p_output_scenario_name)
Return the path to the schedule file from a primary path and a scenario name.
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