8#ifndef FMTMASKFILTER_Hm_included
9#define FMTMASKFILTER_Hm_included
12#include <boost/dynamic_bitset.hpp>
13#include <boost/serialization/serialization.hpp>
14#include <boost/serialization/nvp.hpp>
16#include <boost/functional/hash.hpp>
81 FMTMaskFilter(std::vector<FMTMask>& masks,
const std::vector<FMTTheme>& themes);
116 std::vector<const Core::FMTTheme*>
getSelectedThemes(
const std::vector<Core::FMTTheme>& themes)
const;
124 return flippedselection.empty();
133 return selection.empty();
142 return (boost::hash<boost::dynamic_bitset<uint8_t>>()(selection) ^ boost::hash<boost::dynamic_bitset<uint8_t>>()(flippedselection));
150 friend class boost::serialization::access;
160 template<
class Archive>
161 void serialize(Archive& ar,
const unsigned int version)
164 ar & BOOST_SERIALIZATION_NVP(selection);
165 ar & BOOST_SERIALIZATION_NVP(flippedselection);
177 struct hash<
Core::FMTMaskFilter>
182 return (filter.
hash());
#define FMTEXPORT
Definition: FMTutility.h:125
Filter built from masks used to preSolve and postsolve FMTMask objects.
Definition: FMTMaskFilter.h:31
boost::dynamic_bitset< uint8_t > flippedselection
Definition: FMTMaskFilter.h:147
FMTMaskFilter preSolve(const std::vector< FMTTheme > &themes) const
Return a presolved copy of the filter.
FMTMaskFilter(const FMTMask &presolveselection)
Construct a filter from a preSolve selection mask.
bool canPreSolve(const FMTMask &mask, const std::vector< const Core::FMTTheme * > &themes) const
Return true if the mask can be presolved with the filter.
boost::dynamic_bitset< uint8_t > selection
Definition: FMTMaskFilter.h:146
bool empty() const
Return true if the selection is empty.
Definition: FMTMaskFilter.h:131
void swap(FMTMaskFilter &rhs)
Swap this filter with another.
FMTMaskFilter(const FMTMaskFilter &rhs)
Copy constructor for FMTMaskFilter.
size_t hash() const
Return the hash of the filter.
Definition: FMTMaskFilter.h:140
std::vector< const Core::FMTTheme * > getSelectedThemes(const std::vector< Core::FMTTheme > &themes) const
Return the themes selected by the filter.
FMTMaskFilter(std::vector< FMTMask > &masks, const std::vector< FMTTheme > &themes)
Construct a filter from a vector of masks and the themes.
FMTMask filter(const FMTMask &devmask) const
Filter a development mask.
bool emptyFlipped() const
Return true if the flipped selection is empty.
Definition: FMTMaskFilter.h:122
virtual ~FMTMaskFilter()=default
Default virtual destructor for FMTMaskFilter.
FMTMaskFilter(std::vector< FMTMask > &masks)
Construct a filter from a vector of masks.
FMTMaskFilter()
Default constructor for FMTMaskFilter.
FMTMaskFilter(const FMTMask &presolveselection, const FMTMask &buffermask)
Construct a filter from a preSolve selection mask and a buffer mask.
Core class holding, as a boost dynamic bitset, which theme attributes are part of a mask.
Definition: FMTMask.h:96
Class holding the attributes and aggregates of a single theme, describing a part of a FMTMask.
Definition: FMTTheme.h:47
The Core namespace provides classes for simulating stands/strata growth/harvest through time.
Definition: FMTAction.h:34
Definition: FMTAction.h:463
std::size_t operator()(const Core::FMTMaskFilter &filter) const
Definition: FMTMaskFilter.h:179