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> {
39 RangeQuery(MatchFuncArgType lower, MatchFuncArgType upper)
70 const MatchFuncArgType
getTol()
const {
return this->
d_tol; };
72 bool Match(
const DataFuncArgType what)
const {
73 MatchFuncArgType mfArg =
77 bool lowerRes, upperRes;
87 bool tempR = !(lowerRes && upperRes);
108 std::ostringstream res;
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 MatchFuncArgType getTol() const
returns our tolerance
void setNegation(bool what)
sets whether or not we are negated
void setUpper(MatchFuncArgType what)
sets our upper bound
Query< MatchFuncArgType, DataFuncArgType, needsConversion > * copy() const
returns a copy of this Query
bool getNegation() const
returns whether or not we are negated
void setTol(MatchFuncArgType what)
sets our tolerance
std::pair< bool, bool > getEndsOpen() const
returns the state of our ends (open or not)
const MatchFuncArgType getLower() const
returns our lower bound
a Query implementing a range: arguments must fall in a particular range of values.
class to allow integer values to pick templates
void setLower(MatchFuncArgType what)
sets our lower bound
std::string getFullDescription() const
returns a fuller text description
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
const MatchFuncArgType getUpper() const
returns our upper bound
std::string d_description
const std::string & getDescription() const
returns our text description
MatchFuncArgType TypeConvert(MatchFuncArgType what, Int2Type< false >) const
calls our dataFunc (if it's set) on what and returns the result, otherwise returns what ...
bool Match(const DataFuncArgType what) const
returns whether or not we match the argument
Base class for all queries.