FMT 1.2.0
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTEventRelation.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 FMTeventrelation_Hm_included
9#define FMTeventrelation_Hm_included
10
11#include "FMTCoordinate.h"
12#include <boost/functional/hash.hpp>
13
14namespace Spatial
15{
16 class FMTEvent;
17}
18
19namespace Spatial
20{
21 // DocString: FMTEventRelation
26 {
27 public:
28 // DocString: FMTEventRelation(const Spatial::FMTEvent&,const Spatial::FMTEvent&)
34 FMTEventRelation(const Spatial::FMTEvent& fromevent, const Spatial::FMTEvent& toevent);
35 // DocString: FMTEventRelation::operator==
41 bool operator == (const FMTEventRelation& rhs) const;
42 // DocString: FMTEventRelation::hash
47 size_t hash() const;
48 // DocString: FMTEventRelation(const FMTEventRelation&)
53 FMTEventRelation(const FMTEventRelation& rhs) = default;
54 // DocString: FMTEventRelation::operator=
61 // DocString: ~FMTEventRelation()
65 ~FMTEventRelation() = default;
66 private:
67 int m_fromaction;
68 int m_toaction;
69 int m_fromperiod;
70 int m_toperiod;
71 FMTCoordinate m_fromcoord;
72 FMTCoordinate m_tocoord;
73 };
74
75}
76
77namespace boost
78 {
79 template <>
80 struct hash<Spatial::FMTEventRelation>
81 {
82 std::size_t operator()(const Spatial::FMTEventRelation& relation) const
83 {
84 return relation.hash();
85 }
86 };
87 }
88
89
90#endif
Spatially referenced coordinate holding an x and y position on a raster grid.
Definition: FMTCoordinate.h:29
Relation between two spatial events, holding the from and to action, period and coordinate of the clo...
Definition: FMTEventRelation.h:26
~FMTEventRelation()=default
Default destructor for FMTEventRelation.
bool operator==(const FMTEventRelation &rhs) const
Comparison operator for FMTEventRelation.
FMTEventRelation & operator=(const FMTEventRelation &rhs)=default
Copy assignment operator for FMTEventRelation.
FMTEventRelation(const Spatial::FMTEvent &fromevent, const Spatial::FMTEvent &toevent)
Construct a FMTEventRelation from two events.
size_t hash() const
Hash the event relation.
FMTEventRelation(const FMTEventRelation &rhs)=default
Copy constructor for FMTEventRelation.
Base class for a spatial event (FMTsaevent or FMTsesevent): a set of FMTCoordinate corresponding to t...
Definition: FMTEvent.h:28
Definition: FMTAreaParser.h:40
Definition: FMTAction.h:463
std::size_t operator()(const Spatial::FMTEventRelation &relation) const
Definition: FMTEventRelation.h:82