FMT 1.2.0
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTEdgeProperties.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 FMTedgeproperties_Hm_included
9#define FMTedgeproperties_Hm_included
10
11#include <boost/serialization/serialization.hpp>
12#include <boost/serialization/nvp.hpp>
13#include <vector>
14#include <string>
16
17namespace Graph
18{
19 // DocString: FMTEdgeProperties
24 {
26 // DocString: FMTEdgeProperties::serialize
33 template<class Archive>
34 void serialize(Archive& ar, const unsigned int version)
35 {
36 ar& boost::serialization::make_nvp("FMTbaseedgeproperties", boost::serialization::base_object<FMTBaseEdgeProperties>(*this));
37 ar& BOOST_SERIALIZATION_NVP(variableID);
38 ar& BOOST_SERIALIZATION_NVP(proportion);
39 }
40 int variableID;
41 float proportion;
42 public:
43 // DocString: ~FMTEdgeProperties()
47 ~FMTEdgeProperties() = default;
48 // DocString: FMTEdgeProperties()
52 FMTEdgeProperties() = default;
53 // DocString: FMTEdgeProperties(const FMTEdgeProperties&)
58 FMTEdgeProperties(const FMTEdgeProperties& rhs) = default;
59 // DocString: FMTEdgeProperties::operator=
66 // DocString: FMTEdgeProperties::getVariableID
71 inline int getVariableID() const override
72 {
73 return variableID;
74 }
75 // DocString: FMTEdgeProperties::setVariableID
80 void setVariableID(const int& newvariableID);
81 // DocString: FMTEdgeProperties::getProportion
86 inline double getProportion() const override
87 {
88 return static_cast<double>(proportion);
89 }
90 // DocString: FMTEdgeProperties(const int&,const int&,const double&)
97 FMTEdgeProperties(const int& laction,
98 const int& lvariableID,
99 const double& lproportion);
100 // DocString: FMTEdgeProperties::operator==
106 bool operator == (const FMTEdgeProperties& rhs) const;
107 // DocString: FMTEdgeProperties::operator!=
113 bool operator != (const FMTEdgeProperties& rhs) const;
114 // DocString: FMTEdgeProperties::variableName
119 inline std::string variableName() const;
120 // DocString: FMTEdgeProperties::getVariablePtr
125 inline const int* getVariablePtr() const
126 {
127 return &variableID;
128 }
129
130 };
131}
132
133BOOST_CLASS_EXPORT_KEY(Graph::FMTEdgeProperties)
134
135#endif
Base edge properties of a FMTGraph, holding the action of the edge.
Definition: FMTBaseEdgeProperties.h:31
Edge properties of a FMTGraph, extending the base edge properties with a variable id and a proportion...
Definition: FMTEdgeProperties.h:24
const int * getVariablePtr() const
Return a pointer to the variable id of the edge.
Definition: FMTEdgeProperties.h:125
int getVariableID() const override
Return the variable id of the edge.
Definition: FMTEdgeProperties.h:71
bool operator!=(const FMTEdgeProperties &rhs) const
Comparison operator for FMTEdgeProperties.
FMTEdgeProperties(const FMTEdgeProperties &rhs)=default
Copy constructor for FMTEdgeProperties.
void setVariableID(const int &newvariableID)
Set the variable id of the edge.
double getProportion() const override
Return the proportion of the edge.
Definition: FMTEdgeProperties.h:86
std::string variableName() const
Return the name of the variable of the edge.
FMTEdgeProperties & operator=(const FMTEdgeProperties &rhs)=default
Copy assignment operator for FMTEdgeProperties.
FMTEdgeProperties()=default
Default constructor for FMTEdgeProperties.
bool operator==(const FMTEdgeProperties &rhs) const
Comparison operator for FMTEdgeProperties.
friend class boost::serialization::access
Definition: FMTEdgeProperties.h:25
~FMTEdgeProperties()=default
Default destructor for FMTEdgeProperties.
FMTEdgeProperties(const int &laction, const int &lvariableID, const double &lproportion)
Construct a FMTEdgeProperties from an action, a variable id and a proportion.
Definition: FMTAreaParser.h:35