47 #ifndef Foam_scalarRange_H 48 #define Foam_scalarRange_H 59 template<
class T>
class MinMax;
203 inline scalar
value()
const;
206 inline bool contains(
const scalar val)
const;
constexpr scalarRange() noexcept
Construct an empty (inverse, NONE) range - never matches.
static constexpr scalarRange gt0() noexcept
A greater-than zero bound.
A min/max value pair with additional methods. In addition to conveniently storing values...
bool contains(const scalar val) const
True if the value is matched by the condition.
bool good() const noexcept
True if range is non-empty.
friend Ostream & operator<<(Ostream &os, const scalarRange &range)
Print information about the range.
scalar max() const noexcept
The max value of the range.
bool match(const scalar value) const
True if the value is matched by the condition.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
static const scalarRange always
A range that always matches.
static bool parse(const std::string &str, scalarRange &range)
Construct by parsing string content.
void clear() noexcept
Reset to an empty (inverse, NONE) range.
bool operator()(const scalar value) const
For use as a predicate, same as contains(), match()
static constexpr scalarRange ge(const scalar minVal) noexcept
A greater-equals bound.
scalar value_type
Type of values the range contains.
static constexpr scalarRange ge0() noexcept
A greater-equals zero bound.
OBJstream os(runTime.globalPath()/outputName)
static constexpr scalarRange gt(const scalar minVal) noexcept
A greater-than bound.
scalar min() const noexcept
The min value of the range.
Represents 0/1 range or concept. Used for tagged dispatch or clamping.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
constexpr bool operator!=(const scalarRange &rhs) const noexcept
bool empty() const noexcept
True if range is empty (eg, inverted, NONE)
bool valid() const noexcept
Same as good() or !empty()
static constexpr scalarRange le(const scalar maxVal) noexcept
A less-equals bound.
scalar value() const
A representative (average) value for the range.
constexpr bool operator==(const scalarRange &rhs) const noexcept
static constexpr scalarRange lt(const scalar maxVal) noexcept
A less-than bound.
bool single() const noexcept
True if the range bounds represent a single value.
Scalar bounds to be used as a unary predicate.