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