11 #ifndef __RD_EQUALITYQUERY_H__ 12 #define __RD_EQUALITYQUERY_H__ 20 template <
typename MatchFuncArgType,
21 typename DataFuncArgType = MatchFuncArgType,
22 bool needsConversion =
false>
24 :
public Query<MatchFuncArgType, DataFuncArgType, needsConversion> {
41 const MatchFuncArgType
getVal()
const {
return this->
d_val; };
46 const MatchFuncArgType
getTol()
const {
return this->
d_tol; };
48 virtual bool Match(
const DataFuncArgType what)
const {
49 MatchFuncArgType mfArg =
79 std::ostringstream res;
81 res <<
" " << this->
d_val;
int queryCmp(const T1 v1, const T2 v2, const T1 tol)
void setNegation(bool what)
sets whether or not we are negated
void setTol(MatchFuncArgType what)
sets our tolerance
bool getNegation() const
returns whether or not we are negated
virtual Query< MatchFuncArgType, DataFuncArgType, needsConversion > * copy() const
returns a copy of this Query
virtual bool Match(const DataFuncArgType what) const
returns whether or not we match the argument
std::string getFullDescription() const
returns a fuller text description
void setVal(MatchFuncArgType what)
sets our target value
class to allow integer values to pick templates
EqualityQuery(MatchFuncArgType v, MatchFuncArgType t)
constructs with our target value and a tolerance
MatchFuncArgType(* d_dataFunc)(DataFuncArgType)
a Query implementing ==: arguments must match a particular value (within an optional tolerance) ...
const MatchFuncArgType getVal() const
returns our target value
void setDataFunc(MatchFuncArgType(*what)(DataFuncArgType))
sets our data function
const MatchFuncArgType getTol() const
returns out tolerance
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 ...
Base class for all queries.
EqualityQuery(MatchFuncArgType v)
constructs with our target value