FMT 1.2.0
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTGraphInfo.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#ifndef FMTGRAPHINFO_H
8#define FMTGRAPHINFO_H
9
10
11#include <vector>
12#include <memory>
13#include "FMTGraphValues.h"
14
15namespace Spatial
16 {
17 // DocString: FMTGraphInfo
22 {
23 public:
24 // DocString: FMTGraphInfo()
28 FMTGraphInfo() = default;
29 // DocString: FMTGraphInfo(size_t)
34 FMTGraphInfo(size_t Id);
35 // DocString: FMTGraphInfo::getValues
41 const std::vector<double>& getValues(size_t p_ConstraintId) const;
42 // DocString: FMTGraphInfo::getGraphId
47 inline size_t getGraphId() const
48 {
49 return m_GraphId;
50 }
51 // DocString: FMTGraphInfo::setValues
57 void setValues(size_t p_ConstraintId,
58 const std::shared_ptr<const FMTGraphValues>& p_Values);
59 // DocString: FMTGraphInfo::setValuesSize
64 void setValuesSize(size_t p_ValuesSize);
65 // DocString: FMTGraphInfo::isEmpty
70 bool isEmpty() const;
71 private:
72 // Interned values are shared through shared_ptr (see FMTSpatialGraphs::_InternValues),
73 // which replaces the former boost::flyweight process-wide static factory.
74 std::vector<std::shared_ptr<const FMTGraphValues>> m_Values;
75 size_t m_GraphId;
76 };
77 }
78
79
80#endif
Information about a spatial line graph: its id and the interned constraint values shared across ident...
Definition: FMTGraphInfo.h:22
size_t getGraphId() const
Return the graph id.
Definition: FMTGraphInfo.h:47
const std::vector< double > & getValues(size_t p_ConstraintId) const
Return the values of a constraint for the graph.
bool isEmpty() const
Return true if the graph info has no values.
void setValuesSize(size_t p_ValuesSize)
Reserve the number of constraint value vectors of the graph.
void setValues(size_t p_ConstraintId, const std::shared_ptr< const FMTGraphValues > &p_Values)
Set the interned values of a constraint for the graph.
FMTGraphInfo(size_t Id)
Construct a FMTGraphInfo from a graph id.
FMTGraphInfo()=default
Default constructor for FMTGraphInfo.
Definition: FMTAreaParser.h:40