FMT 1.2.0
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTVertexProperties.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 FMTvertexproperties_Hm_included
9#define FMTvertexproperties_Hm_included
10
11
12#include <boost/serialization/serialization.hpp>
13#include <boost/functional/hash.hpp>
15#include <boost/serialization/export.hpp>
16#include "FMTutility.h"
17
18namespace Core
19{
20 class FMTFuturDevelopment;
21 class FMTActualDevelopment;
22}
23
24
25
26namespace Graph
27{
28 // DocString: FMTVertexProperties
33 {
34 friend class boost::serialization::access;
35 // DocString: FMTVertexProperties::serialize
42 template<class Archive>
43 void serialize(Archive& ar, const unsigned int version)
44 {
45 ar & boost::serialization::make_nvp("FMTbasevertexproperties", boost::serialization::base_object<FMTBaseVertexProperties>(*this));
46 ar & BOOST_SERIALIZATION_NVP(constraintID);
47 }
48 int constraintID;
49 public:
50 // DocString: ~FMTVertexProperties()
55 // DocString: FMTVertexProperties()
60 // DocString: FMTVertexProperties(const FMTVertexProperties&)
66 // DocString: FMTVertexProperties::operator=
72 FMTVertexProperties& operator = (const FMTVertexProperties& rhs) = default;
73 // DocString: FMTVertexProperties(const Core::FMTFuturDevelopment&,const int&)
80 const int& lconstraintID);
81 // DocString: FMTVertexProperties(const Core::FMTActualDevelopment&,const int&)
88 const int& lconstraintID);
89 // DocString: FMTVertexProperties(const Core::FMTDevelopment&,const int&)
96 const int& lconstraintID);
97 // DocString: FMTVertexProperties::constraintName
102 std::string constraintName() const;
103 // DocString: FMTVertexProperties::getConstraintId
108 inline int getConstraintId() const override
109 {
110 return constraintID;
111 }
112 // DocString: FMTVertexProperties::setConstraintId
117 void setConstraintId(const int& ID);
118 };
119}
120
121BOOST_CLASS_EXPORT_KEY(Graph::FMTVertexProperties)
122
123namespace boost {
124
125 template <>
126 struct hash<Graph::FMTVertexProperties>
127 {
128 std::size_t operator()(const Graph::FMTVertexProperties& vertex_properties) const
129 {
130 return vertex_properties.hash();
131 }
132 };
133
134
135}
136
137
138#endif
#define FMTEXPORT
Definition: FMTutility.h:125
Child class of FMTDevelopment representing an actual forest stand, holding the area of the stand.
Definition: FMTActualDevelopment.h:24
Base class of FMTActualDevelopment and FMTFuturDevelopment representing a forest stand.
Definition: FMTDevelopment.h:44
Child class of FMTDevelopment representing a future stand generated by growth or transition,...
Definition: FMTFuturDevelopment.h:23
Definition: FMTBaseVertexProperties.h:33
size_t hash() const
Hash the development of the vertex.
Vertex properties of a FMTGraph, extending the base vertex properties with a constraint id.
Definition: FMTVertexProperties.h:33
FMTVertexProperties(const FMTVertexProperties &rhs)
Copy constructor for FMTVertexProperties.
int getConstraintId() const override
Return the constraint id of the vertex.
Definition: FMTVertexProperties.h:108
FMTVertexProperties(const Core::FMTFuturDevelopment &ldevelopment, const int &lconstraintID)
Construct a FMTVertexProperties from a futur development and a constraint id.
void setConstraintId(const int &ID)
Set the constraint id of the vertex.
~FMTVertexProperties()=default
Default destructor for FMTVertexProperties.
FMTVertexProperties()=default
Default constructor for FMTVertexProperties.
FMTVertexProperties(const Core::FMTActualDevelopment &ldevelopment, const int &lconstraintID)
Construct a FMTVertexProperties from an actual development and a constraint id.
FMTVertexProperties(const Core::FMTDevelopment &ldevelopment, const int &lconstraintID)
Construct a FMTVertexProperties from a development and a constraint id.
std::string constraintName() const
Return the name of the constraint of the vertex.
The Core namespace provides classes for simulating stands/strata growth/harvest through time.
Definition: FMTAction.h:34
Definition: FMTAreaParser.h:35
Definition: FMTAction.h:463
std::size_t operator()(const Graph::FMTVertexProperties &vertex_properties) const
Definition: FMTVertexProperties.h:128