20#ifndef ACTION_RESULT_HPP
21#define ACTION_RESULT_HPP
28namespace Opm::Action {
86 using RandIt =
typename std::vector<T>::const_iterator;
102 , isSorted_ { isSorted }
106 auto begin()
const {
return this->first_; }
109 auto end()
const {
return this->last_; }
115 auto size()
const {
return std::distance(this->
begin(), this->
end()); }
122 return { this->
begin(), this->
end() };
132 return this->isSorted_
133 ? this->hasElementSorted(elem)
134 : this->hasElementUnsorted(elem);
145 bool isSorted_{
false};
152 bool hasElementSorted(
const T& elem)
const
154 return std::binary_search(this->
begin(), this->
end(), elem);
162 bool hasElementUnsorted(
const T& elem)
const
164 return std::find(this->
begin(), this->
end(), elem)
225 bool hasWell(
const std::string& well)
const;
243 std::unique_ptr<Impl> pImpl_;
251 void addWell(
const std::string& well);
259 void addWells(
const std::vector<std::string>& wells);
290 explicit Result(
bool result_arg);
330 Result& wells(
const std::vector<std::string>& w);
336 bool conditionSatisfied()
const;
387 std::unique_ptr<Impl> pImpl_{};
Implementation of Action::Result.
Definition ActionResult.cpp:571
Implementation of Result::MatchingEntities.
Definition ActionResult.cpp:354
Container of matching entities.
Definition ActionResult.hpp:174
bool operator==(const MatchingEntities &that) const
Assignment operator.
Definition ActionResult.cpp:536
MatchingEntities()
Default constructor.
Definition ActionResult.cpp:496
~MatchingEntities()
Destructor.
Random access range of values.
Definition ActionResult.hpp:80
typename std::vector< T >::const_iterator RandIt
Random access iterator.
Definition ActionResult.hpp:86
auto begin() const
Beginning of value range's elements.
Definition ActionResult.hpp:106
bool hasElement(const T &elem) const
Element existence predicate.
Definition ActionResult.hpp:130
auto empty() const
Predicate for an empty value range.
Definition ActionResult.hpp:112
ValueRange(RandIt first, RandIt last, bool isSorted=false)
Constructor.
Definition ActionResult.hpp:99
auto size() const
Number of elements in the value range.
Definition ActionResult.hpp:115
std::vector< T > asVector() const
Convert value range to a std::vector.
Definition ActionResult.hpp:120
auto end() const
End of value range's elements.
Definition ActionResult.hpp:109
Class Action::Result holds the boolean result of a ACTIONX condition like.
Definition ActionResult.hpp:69
bool operator==(const Result &that) const
Equality predicate.
Definition ActionResult.cpp:726
Result & makeSetUnion(const Result &rhs)
Assignment operator.
Definition ActionResult.cpp:707
const MatchingEntities & matches() const
Retrieve set of matching entities.
Definition ActionResult.cpp:721
Result & makeSetIntersection(const Result &rhs)
Incorporate another result set into the current set as if by set intersection.
Definition ActionResult.cpp:714