FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTconstants.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 FMTCON_H_INCLUDED
9#define FMTCON_H_INCLUDED
10
11#include <boost/unordered_map.hpp>
12#include <boost/serialization/serialization.hpp>
13#include <boost/serialization/nvp.hpp>
14#include <boost/serialization/export.hpp>
15#include <vector>
16#include <string>
17#include "FMTobject.hpp"
19
20namespace Core
21{
22// DocString: FMTconstants
29 {
30 // DocString: FMTconstants::serialize
34 friend class boost::serialization::access;
35 template<class Archive>
36 void serialize(Archive& ar, const unsigned int version)
37 {
38 try{
39 ar & BOOST_SERIALIZATION_NVP(data);
40 }catch (...)
41 {
42 _exhandler->printexceptions("", "FMTconstants::serialize", __LINE__, __FILE__);
43 }
44 }
45 // DocString: FMTconstants::data
47 boost::unordered_map<std::string,std::vector<double>>data;
48 public:
49 // DocString: FMTconstants()
54 // DocString: ~FMTconstants()
58 ~FMTconstants()=default;
59 // DocString: FMTconstants(const FMTconstants&)
64 // DocString: FMTconstants::set
68 void set(const std::string& key, std::vector<double>values);
69 // DocString: FMTconstants::get
73 template<typename T>
74 T get(std::string key, int period = 0) const;
75 // DocString: FMTconstants::getall
79 template<typename T>
80 std::vector<T>getall(std::string key) const;
81 // DocString: FMTconstants::isconstant
85 bool isconstant(std::string value) const;
86 // DocString: FMTconstants::length
90 size_t length(std::string value) const;
91 // DocString: FMTconstants::operator=
95 FMTconstants& operator = (const FMTconstants& rhs);
96 // DocString: FMTconstants::operator std::string
100 operator std::string() const;
101 };
102}
103
104BOOST_CLASS_EXPORT_KEY(Core::FMTconstants)
105
106#endif // FMTCON_H_INCLUDED
#define FMTEXPORT
Definition: FMTutility.hpp:92
Definition: FMTconstants.hpp:29
~FMTconstants()=default
std::vector< T > getall(std::string key) const
void set(const std::string &key, std::vector< double >values)
T get(std::string key, int period=0) const
FMTconstants(const FMTconstants &rhs)
bool isconstant(std::string value) const
size_t length(std::string value) const
Definition: FMTobject.hpp:50
The Core namespace provides classes for simulating stands/strata growth/harvest through time.
Definition: FMTaction.hpp:31