69 Info<<
"constructed scalarRange: " << *
this <<
endl;
78 return type_ == EMPTY;
84 return type_ != EMPTY;
90 return type_ == EXACT;
136 return value >= value_;
139 return value <= value_;
142 return value >= value_ && value <= value2_;
145 return value == value_;
161 && value_ == range.value_
162 && value2_ == range.value2_
177 range.type_ = scalarRange::EXACT;
188 is.
check(
"scalarRange token read");
192 toks[nTok].isPunctuation()
201 toks[nTok-1].isPunctuation()
205 range.type_ = scalarRange::UPPER;
206 is.
read(toks[nTok++]);
207 is.
check(
"scalarRange token read");
211 if (!toks[nTok-1].isNumber())
214 range.type_ = scalarRange::EMPTY;
215 range.value_ = range.value2_ = 0;
216 Info<<
"rejected ill-formed or empty range:";
217 for (
label i=0; i<nTok; ++i)
219 Info<<
" " << toks[i];
225 range.value_ = toks[nTok-1].number();
226 is.
read(toks[nTok++]);
227 is.
check(
"scalarRange token read");
232 for (
label i=0; i<nTok; ++i)
234 Info<<
" " << toks[i];
242 toks[nTok-1].isPunctuation()
246 if (range.type_ == scalarRange::UPPER)
249 range.type_ = scalarRange::EMPTY;
250 range.value_ = range.value2_ = 0;
251 Info<<
"rejected ill-formed range:";
252 for (
label i=0; i<nTok; ++i)
254 Info<<
" " << toks[i];
260 is.
read(toks[nTok++]);
261 is.
check(
"scalarRange token read");
266 for (
label i=0; i<nTok; ++i)
268 Info<<
" " << toks[i];
275 if (toks[nTok-1].isNumber())
277 range.type_ = scalarRange::RANGE;
278 range.value2_ = toks[nTok-1].number();
279 is.
read(toks[nTok++]);
280 is.
check(
"scalarRange token read");
284 range.type_ = scalarRange::LOWER;
291 for (
label i=0; i<nTok; ++i)
293 Info<<
" " << toks[i];
306 !toks[nTok-1].isPunctuation()
312 range.type_ = scalarRange::EMPTY;
313 range.value_ = range.value2_ = 0;
315 Info<<
"rejected ill-formed range:";
316 for (
label i=0; i<nTok; ++i)
318 Info<<
" " << toks[i];
331 case scalarRange::LOWER:
332 os << range.value_ <<
" <=> Inf";
335 case scalarRange::UPPER:
336 os <<
"-Inf <=> " << range.value_;
339 case scalarRange::RANGE:
340 os << range.value_ <<
" <=> " << range.value2_;
343 case scalarRange::EXACT:
bool valid() const
Is the range non-empty?
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool operator!=(const scalarRange &) const
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool selected(const scalar) const
Return true if the value is within the range.
bool empty() const
Is the range empty?
void setBad()
Set stream to be bad.
virtual Istream & read(token &)=0
Return next token from stream.
bool operator==(const scalarRange &) const
Istream & operator>>(Istream &, directionInfo &)
int debugSwitch(const char *name, const int defaultValue=0)
Lookup debug switch or add default value.
scalar upper() const
The upper limit.
bool isExact() const
Is the range 'EXACT'?
scalar lower() const
The lower limit.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
scalarRange()
Construct an empty range.
Ostream & operator<<(Ostream &, const ensightPart &)
scalar value() const
The value constituting an 'EXACT' match.
A scalar range specifier.