FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTtimeyieldhandler.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 FMTTIMEYIELDHANDLER_H_INCLUDED
9#define FMTTIMEYIELDHANDLER_H_INCLUDED
10
11#include "FMTyieldhandler.hpp"
12#include "FMTdata.hpp"
13#include <string>
14#include <boost/serialization/serialization.hpp>
15#include <boost/serialization/nvp.hpp>
16
17namespace Core
18{
19
21 {
22 friend class boost::serialization::access;
23 template<class Archive>
24 void serialize(Archive& ar, const unsigned int version)
25 {
26 ar & boost::serialization::make_nvp("FMTyieldhandler", boost::serialization::base_object<FMTyieldhandler>(*this));
27 ar & BOOST_SERIALIZATION_NVP(elements);
28 }
29 std::map<std::string, FMTdata>elements;
30 public:
31 virtual double get(const std::string& yld, const FMTyieldrequest& request) const;
32 virtual operator std::string() const;
36 FMTtimeyieldhandler& operator = (const FMTtimeyieldhandler& rhs) = default;
37 // DocString: FMTtimeyieldhandler(const FMTmask&)
42 // DocString: FMTtimeyieldhandler::setyieldvalues
46 virtual void setyieldvalues(const std::string& yldname,const int& startingperiod,const std::vector<double>& values);
47 virtual double getlastvalue(const std::string yld) const;
48 virtual bool push_data(const std::string& yld, const double& value);
49 virtual bool push_data(const std::string& yld, const FMTdata& data);
50 virtual std::unique_ptr<FMTyieldhandler>clone() const;
51 virtual bool operator == (const FMTtimeyieldhandler& rhs) const;
52 virtual bool empty() const;
53 virtual size_t size() const;
54 virtual FMTyldtype gettype() const;
55 virtual FMTdata& operator[](const std::string& yldname);
56 virtual const FMTdata& at(const std::string& yldname) const;
57 virtual bool containsyield(const std::string& yldname) const;
58 virtual std::vector<std::string>getyieldnames() const;
59 virtual void clearcache();
60 virtual std::map<std::string, std::vector<double>>getallyieldsdata(const int& maxbase)const;
61 virtual std::unique_ptr<FMTyieldhandler> getfromfactor(const double& factor,
62 std::vector<std::string>yieldnames = std::vector<std::string>()) const;
63 };
64
65}
66
67#endif
#define FMTEXPORT
Definition: FMTutility.hpp:92
Definition: FMTdata.hpp:32
Definition: FMTmask.hpp:96
Definition: FMTtimeyieldhandler.hpp:21
FMTtimeyieldhandler(const FMTtimeyieldhandler &rhs)=default
virtual bool push_data(const std::string &yld, const double &value)
virtual double getlastvalue(const std::string yld) const
virtual void clearcache()
virtual bool empty() const
virtual std::vector< std::string > getyieldnames() const
virtual const FMTdata & at(const std::string &yldname) const
virtual FMTdata & operator[](const std::string &yldname)
virtual std::unique_ptr< FMTyieldhandler > getfromfactor(const double &factor, std::vector< std::string >yieldnames=std::vector< std::string >()) const
virtual void setyieldvalues(const std::string &yldname, const int &startingperiod, const std::vector< double > &values)
virtual bool containsyield(const std::string &yldname) const
virtual std::map< std::string, std::vector< double > > getallyieldsdata(const int &maxbase) const
virtual size_t size() const
virtual FMTyldtype gettype() const
virtual bool push_data(const std::string &yld, const FMTdata &data)
FMTtimeyieldhandler(const FMTmask &mask)
virtual double get(const std::string &yld, const FMTyieldrequest &request) const
virtual std::unique_ptr< FMTyieldhandler > clone() const
Definition: FMTyieldhandler.hpp:31
Definition: FMTyieldrequest.hpp:36
The Core namespace provides classes for simulating stands/strata growth/harvest through time.
Definition: FMTaction.hpp:31
FMTyldtype
Definition: FMTutility.hpp:45