20#ifndef REGION_SET_MATCHER_HPP
21#define REGION_SET_MATCHER_HPP
35 class FIPRegionStatistics;
40class RegionSetMatcher;
108 return this->i_ == that.i_;
116 bool operator!=(
Iterator that)
const
118 return ! (*
this == that);
129 Iterator(
int i) : i_{i} {}
136 Iterator begin()
const {
return { this->begin_ }; }
139 Iterator end()
const {
return { this->end_ }; }
142 bool empty()
const {
return this->end_ <= this->begin_; }
145 std::string_view regionSet()
const {
return this->region_; }
147 friend class RegionSetMatchResult;
157 std::string_view region_{};
164 RegionIndexRange() =
default;
176 RegionIndexRange(
int beginID,
int endID, std::string_view region)
188 return this->regionIDRange_.empty();
198 bool isScalar()
const
200 return (this->regionIDRange_.size() == std::vector<int>::size_type{2})
201 && (this->regionIDRange_.back() == this->regionIDRange_.front() + 1);
207 std::vector<std::string_view> regionSets()
const;
212 std::size_t numRegionSets()
const
214 return this->regionSets_.size();
242 std::vector<std::string> regionSets_{};
248 std::vector<std::vector<std::string>::size_type> regionSetIndex_{};
251 std::vector<int> regionIDRange_{};
256 void establishNameLookupIndex();
269 void addRegionIndices(
const std::string& regSet,
297class RegionSetMatcher
313 SetDescriptor& regionID(
const int region);
326 SetDescriptor& regionID(std::string_view region);
331 const std::optional<int>& regionID()
const
333 return this->regionId_;
341 SetDescriptor& vectorName(std::string_view vector);
347 const std::optional<std::string>& regionSet()
const
349 return this->regionSet_;
355 std::optional<std::string> regionSet_{};
359 std::optional<int> regionId_{};
391 RegionSetMatcher&
operator=(
const RegionSetMatcher& rhs) =
delete;
431 std::unique_ptr<Impl> pImpl_{};
Basic descriptive statistics about a model's fluid-in-place regions.
Definition FIPRegionStatistics.hpp:40
Simple forward iterator over a region index range.
Definition RegionSetMatcher.hpp:52
int & reference
Iterator's reference type (return type from operator*())
Definition RegionSetMatcher.hpp:67
RegionIndexRange regions(std::string_view regSet) const
Inequality predicate.
Iterator operator++(int)
Post-increment operator.
Definition RegionSetMatcher.hpp:82
reference operator*()
Dereference operator.
Definition RegionSetMatcher.hpp:94
std::forward_iterator_tag iterator_category
Iterator's category (forward iterator)
Definition RegionSetMatcher.hpp:55
int value_type
Iterator's value type.
Definition RegionSetMatcher.hpp:58
int difference_type
Iterator's difference type.
Definition RegionSetMatcher.hpp:61
pointer operator->()
Indirection operator.
Definition RegionSetMatcher.hpp:99
int * pointer
Iterator's pointer type (return type from operator->())
Definition RegionSetMatcher.hpp:64
RegionIndexRange regions(const std::size_t regSet) const
Retrieve result set's region indices for a single region set.
Iterator & operator++()
Pre-increment operator.
Definition RegionSetMatcher.hpp:72
bool operator==(Iterator that) const
Equality predicate.
Definition RegionSetMatcher.hpp:106
Region Index Range for Single Region Set.
Definition RegionSetMatcher.hpp:48
Result Set From RegionSetMatcher's Matching Process.
Definition RegionSetMatcher.hpp:44
RegionSetMatcher()=delete
Default constructor.
~RegionSetMatcher()
Destructor.
RegionSetMatchResult findRegions(const SetDescriptor ®Set) const
Determine collection of region sets and corresponding region indices matching an input set descriptio...
RegionSetMatcher(const FIPRegionStatistics &fipRegStats)
Constructor.
RegionSetMatcher & operator=(RegionSetMatcher &&rhs)
Move-assignment operator.
RegionSetMatcher(RegionSetMatcher &&rhs)
Move constructor.
RegionSetMatcher(const RegionSetMatcher &rhs)=delete
Copy constructor.
RegionSetMatcher & operator=(const RegionSetMatcher &rhs)=delete
Assignment operator.
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30