10 #ifndef __RD_RANGEQUERY_H__ 11 #define __RD_RANGEQUERY_H__ 24 template <
class MatchFuncArgType,
class DataFuncArgType=MatchFuncArgType,
25 bool needsConversion=
false>
27 public Query<MatchFuncArgType, DataFuncArgType,needsConversion> {
60 const MatchFuncArgType
getTol()
const {
return this->
d_tol; };
62 bool Match(
const DataFuncArgType what)
const {
66 bool lowerRes,upperRes;
68 else lowerRes = lCmp <= 0;
70 else upperRes = uCmp >= 0;
72 bool tempR = !(lowerRes && upperRes);
93 std::ostringstream res;
bool getNegation() const
returns whether or not we are negated
Query< MatchFuncArgType, DataFuncArgType, needsConversion > * copy() const
returns a copy of this Query
bool Match(const DataFuncArgType what) const
returns whether or not we match the argument
RangeQuery(MatchFuncArgType lower, MatchFuncArgType upper)
construct and set the lower and upper bounds
int queryCmp(const T1 v1, const T2 v2, const T1 tol)
const std::string & getDescription() const
returns our text description
void setNegation(bool what)
sets whether or not we are negated
const MatchFuncArgType getLower() const
returns our lower bound
void setUpper(MatchFuncArgType what)
sets our upper bound
std::pair< bool, bool > getEndsOpen() const
returns the state of our ends (open or not)
MatchFuncArgType TypeConvert(MatchFuncArgType what, Int2Type< false >) const
calls our dataFunc (if it's set) on what and returns the result, otherwise returns what ...
std::string getFullDescription() const
returns a fuller text description
void setTol(MatchFuncArgType what)
sets our tolerance
a Query implementing a range: arguments must fall in a particular range of values.
class to allow integer values to pick templates
const MatchFuncArgType getTol() const
returns our tolerance
void setLower(MatchFuncArgType what)
sets our lower bound
MatchFuncArgType(* d_dataFunc)(DataFuncArgType)
void setEndsOpen(bool lower, bool upper)
sets whether or not the ends of the range are open
void setDataFunc(MatchFuncArgType(*what)(DataFuncArgType))
sets our data function
std::string d_description
const MatchFuncArgType getUpper() const
returns our upper bound
Base class for all queries.