FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMToperator.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 FMTOPE_H_INCLUDED
9#define FMTOPE_H_INCLUDED
10
11#include "FMTutility.hpp"
12#include <string>
13#include <vector>
14#include <boost/functional/hash.hpp>
15#include <boost/serialization/serialization.hpp>
16#include <boost/serialization/nvp.hpp>
17#include "FMTexception.hpp"
18
19
20
21namespace Core
22{
23
24 enum class FMTokey
25 {
26 multiply = 1,
27 divide = 2,
28 add = 3,
29 sub = 4,
30 comma = 5,
31 pow = 6,
32 notvalid = 7
33 };
34
36{
37 FMTokey key;
38 friend class boost::serialization::access;
39 template<class Archive>
40 void serialize(Archive& ar, const unsigned int version)
41 {
42 ar & BOOST_SERIALIZATION_NVP(key);
43 }
44public:
46 ~FMToperator() = default;
48 FMToperator(std::string strkey);
49 bool operator == (const FMToperator& rhs) const;
50 bool operator != (const FMToperator& rhs) const;
51 double call(const double& rhs1, const double& rhs2) const;
53 FMToperator& operator = (const FMToperator& rhs);
54 int precedence() const;
55 std::string associativity() const;
57 bool valid() const;
58 size_t hash() const;
59 bool isfactor() const;
60 bool isdivide() const;
61 FMTokey getkey() const;
62 operator std::string() const;
63};
64
65}
66
67#endif // FMTOPE_H_INCLUDED
#define FMTEXPORT
Definition: FMTutility.hpp:92
Definition: FMToperator.hpp:36
bool isdivide() const
double call(const double &rhs1, const double &rhs2) const
bool valid() const
bool isfactor() const
FMToperator reverse() const
FMToperator(std::string strkey)
FMTokey getkey() const
size_t hash() const
int precedence() const
FMToperator(const FMToperator &rhs)
std::string associativity() const
~FMToperator()=default
FMToperator(FMTokey lkey)
The Core namespace provides classes for simulating stands/strata growth/harvest through time.
Definition: FMTaction.hpp:31
FMTokey
Definition: FMToperator.hpp:25