20 #ifndef REGION_SET_MATCHER_HPP 21 #define REGION_SET_MATCHER_HPP 28 #include <string_view> 35 class FIPRegionStatistics;
40 class RegionSetMatcher;
108 return this->i_ == that.i_;
118 return ! (*
this == that);
129 explicit Iterator(
int i) : i_{i} {}
136 Iterator begin()
const {
return Iterator{this->begin_}; }
139 Iterator end()
const {
return Iterator{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();
226 RegionIndexRange regions(std::string_view regSet)
const;
236 RegionIndexRange regions(
const std::size_t regSet)
const;
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,
297 class 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_{};
365 RegionSetMatcher() =
delete;
370 explicit RegionSetMatcher(
const FIPRegionStatistics& fipRegStats);
377 RegionSetMatcher(
const RegionSetMatcher& rhs) =
delete;
382 RegionSetMatcher(RegionSetMatcher&& rhs);
391 RegionSetMatcher& operator=(
const RegionSetMatcher& rhs) =
delete;
398 RegionSetMatcher& operator=(RegionSetMatcher&& rhs);
424 RegionSetMatchResult findRegions(
const SetDescriptor& regSet)
const;
431 std::unique_ptr<Impl> pImpl_{};
436 #endif // REGION_SET_MATCHER_HPP bool operator==(Iterator that) const
Equality predicate.
Definition: RegionSetMatcher.hpp:106
Simple forward iterator over a region index range.
Definition: RegionSetMatcher.hpp:51
int * pointer
Iterator's pointer type (return type from operator->())
Definition: RegionSetMatcher.hpp:64
std::forward_iterator_tag iterator_category
Iterator's category (forward iterator)
Definition: RegionSetMatcher.hpp:55
RegionSetMatcher()=delete
Default constructor.
int difference_type
Iterator's difference type.
Definition: RegionSetMatcher.hpp:61
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
pointer operator->()
Indirection operator.
Definition: RegionSetMatcher.hpp:99
int & reference
Iterator's reference type (return type from operator*())
Definition: RegionSetMatcher.hpp:67
Region Index Range for Single Region Set.
Definition: RegionSetMatcher.hpp:47
Result Set From RegionSetMatcher's Matching Process.
Definition: RegionSetMatcher.hpp:43
reference operator*()
Dereference operator.
Definition: RegionSetMatcher.hpp:94
Iterator operator++(int)
Post-increment operator.
Definition: RegionSetMatcher.hpp:82
Iterator & operator++()
Pre-increment operator.
Definition: RegionSetMatcher.hpp:72
int value_type
Iterator's value type.
Definition: RegionSetMatcher.hpp:58
bool operator!=(const SummaryConfigNode &lhs, const SummaryConfigNode &rhs)
Inequality operator for SummaryConfigNode objects.
Definition: SummaryConfig.hpp:256