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 operator==(const scalarRange &) const
virtual bool check(const char *operation) const
Check IOstream status for given operation.
bool valid() const
Is the range non-empty?
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)...
bool empty() const
Is the range empty?
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool isExact() const
Is the range 'EXACT'?
void setBad()
Set stream to be bad.
virtual Istream & read(token &)=0
Return next token from stream.
Istream & operator>>(Istream &, directionInfo &)
int debugSwitch(const char *name, const int defaultValue=0)
Lookup debug switch or add default value.
bool selected(const scalar) const
Return true if the value is within the range.
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 lower() const
The lower limit.
scalar value() const
The value constituting an 'EXACT' match.
bool operator!=(const scalarRange &) const
scalar upper() const
The upper limit.
A scalar range specifier.