Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
scalarRange Class Reference

Scalar bounds to be used as a unary predicate. More...

Collaboration diagram for scalarRange:
Collaboration graph
[legend]

Public Types

typedef scalar value_type
 

Public Member Functions

constexpr scalarRange () noexcept
 
constexpr scalarRange (const scalar val) noexcept
 
 scalarRange (const scalar minVal, const scalar maxVal) noexcept
 
 scalarRange (const MinMax< label > &range) noexcept
 
 scalarRange (const MinMax< scalar > &range) noexcept
 
void clear () noexcept
 
bool empty () const noexcept
 
bool valid () const noexcept
 
bool single () const noexcept
 
scalar min () const noexcept
 
scalar max () const noexcept
 
scalar value () const
 
bool match (const scalar &val) const
 
bool operator() (const scalar &val) const
 
constexpr bool operator== (const scalarRange &rhs) const noexcept
 
constexpr bool operator!= (const scalarRange &rhs) const noexcept
 

Static Public Member Functions

static bool parse (const std::string &str, scalarRange &range)
 
static scalarRange parse (const std::string &str)
 
static constexpr scalarRange ge (const scalar minVal) noexcept
 
static constexpr scalarRange gt (const scalar minVal) noexcept
 
static constexpr scalarRange ge0 () noexcept
 
static constexpr scalarRange gt0 () noexcept
 
static constexpr scalarRange le (const scalar maxVal) noexcept
 
static constexpr scalarRange lt (const scalar maxVal) noexcept
 
static constexpr scalarRange zero_one () noexcept
 

Static Public Attributes

static const scalarRange always
 

Friends

Ostreamoperator<< (Ostream &os, const scalarRange &range)
 

Detailed Description

Scalar bounds to be used as a unary predicate.

The bound can be specified as an "MIN:MAX" range, as a "MIN:" or ":MAX" bound or simply as a single "VALUE".

When defined via the parse() method, the special string "none" can be used to define an empty (inverse) range.

See also
Foam::MinMax Foam::predicates::scalars
Source files

Definition at line 64 of file scalarRange.H.

Member Typedef Documentation

◆ value_type

typedef scalar value_type

Definition at line 105 of file scalarRange.H.

Constructor & Destructor Documentation

◆ scalarRange() [1/5]

constexpr scalarRange ( )
inlineconstexprnoexcept

Definition at line 36 of file scalarRangeI.H.

Referenced by scalarRange::parse().

Here is the caller graph for this function:

◆ scalarRange() [2/5]

constexpr scalarRange ( const scalar  val)
inlineexplicitconstexprnoexcept

Definition at line 42 of file scalarRangeI.H.

◆ scalarRange() [3/5]

scalarRange ( const scalar  minVal,
const scalar  maxVal 
)
inlinenoexcept

Definition at line 49 of file scalarRangeI.H.

References clear(), and Foam::equal().

Here is the call graph for this function:

◆ scalarRange() [4/5]

scalarRange ( const MinMax< label > &  range)
explicitnoexcept

Definition at line 131 of file scalarRange.C.

◆ scalarRange() [5/5]

scalarRange ( const MinMax< scalar > &  range)
explicitnoexcept

Definition at line 139 of file scalarRange.C.

Member Function Documentation

◆ parse() [1/2]

bool parse ( const std::string &  str,
scalarRange range 
)
static

Definition at line 39 of file scalarRange.C.

References scalarRange::always, Switch::find(), scalarRange::ge(), Switch::good(), scalarRange::le(), range, and scalarRange::scalarRange().

Here is the call graph for this function:

◆ parse() [2/2]

Foam::scalarRange parse ( const std::string &  str)
static

Definition at line 116 of file scalarRange.C.

References Foam::endl(), Foam::Info, and range.

Here is the call graph for this function:

◆ ge()

constexpr Foam::scalarRange ge ( const scalar  minVal)
inlinestaticconstexprnoexcept

Definition at line 68 of file scalarRangeI.H.

Referenced by scalarRange::parse().

Here is the caller graph for this function:

◆ gt()

constexpr Foam::scalarRange gt ( const scalar  minVal)
inlinestaticconstexprnoexcept

Definition at line 75 of file scalarRangeI.H.

◆ ge0()

constexpr Foam::scalarRange ge0 ( )
inlinestaticconstexprnoexcept

Definition at line 82 of file scalarRangeI.H.

◆ gt0()

constexpr Foam::scalarRange gt0 ( )
inlinestaticconstexprnoexcept

Definition at line 89 of file scalarRangeI.H.

◆ le()

constexpr Foam::scalarRange le ( const scalar  maxVal)
inlinestaticconstexprnoexcept

Definition at line 96 of file scalarRangeI.H.

Referenced by scalarRange::parse().

Here is the caller graph for this function:

◆ lt()

constexpr Foam::scalarRange lt ( const scalar  maxVal)
inlinestaticconstexprnoexcept

Definition at line 102 of file scalarRangeI.H.

◆ zero_one()

constexpr Foam::scalarRange zero_one ( )
inlinestaticconstexprnoexcept

Definition at line 109 of file scalarRangeI.H.

◆ clear()

void clear ( )
inlinenoexcept

Definition at line 117 of file scalarRangeI.H.

◆ empty()

bool empty ( ) const
inlinenoexcept

Definition at line 125 of file scalarRangeI.H.

◆ valid()

bool valid ( ) const
inlinenoexcept

Definition at line 131 of file scalarRangeI.H.

References bool.

◆ single()

bool single ( ) const
inlinenoexcept

Definition at line 137 of file scalarRangeI.H.

◆ min()

Foam::scalar min ( ) const
inlinenoexcept

Definition at line 143 of file scalarRangeI.H.

◆ max()

Foam::scalar max ( ) const
inlinenoexcept

Definition at line 149 of file scalarRangeI.H.

◆ value()

Foam::scalar value ( ) const
inline

Definition at line 155 of file scalarRangeI.H.

◆ match()

bool match ( const scalar &  val) const
inline

Definition at line 178 of file scalarRangeI.H.

References Foam::equal().

Here is the call graph for this function:

◆ operator()()

bool operator() ( const scalar &  val) const
inline

Definition at line 196 of file scalarRangeI.H.

References Foam::stringOps::match().

Here is the call graph for this function:

◆ operator==()

constexpr bool operator== ( const scalarRange rhs) const
inlineconstexprnoexcept

Definition at line 204 of file scalarRangeI.H.

◆ operator!=()

constexpr bool operator!= ( const scalarRange rhs) const
inlineconstexprnoexcept

Definition at line 214 of file scalarRangeI.H.

Friends And Related Function Documentation

◆ operator<<

Ostream& operator<< ( Ostream os,
const scalarRange range 
)
friend

Member Data Documentation

◆ always

const Foam::scalarRange always
static

Definition at line 111 of file scalarRange.H.

Referenced by scalarRange::parse().


The documentation for this class was generated from the following files: