11#ifndef RD_RANGEQUERY_H
12#define RD_RANGEQUERY_H
25template <
class MatchFuncArgType,
class DataFuncArgType = MatchFuncArgType,
26 bool needsConversion =
false>
28 :
public Query<MatchFuncArgType, DataFuncArgType, needsConversion> {
32 RangeQuery(MatchFuncArgType lower, MatchFuncArgType upper)
61 bool Match(
const DataFuncArgType what)
const override {
62 MatchFuncArgType mfArg =
66 bool lowerRes, upperRes;
78 bool tempR = !(lowerRes && upperRes);
102 std::ostringstream res;
class to allow integer values to pick templates
MatchFuncArgType(* d_dataFunc)(DataFuncArgType)
MatchFuncArgType TypeConvert(MatchFuncArgType what, Int2Type< false >) const
calls our dataFunc (if it's set) on what and returns the result, otherwise returns what
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
const std::string & getDescription() const
returns our text description
std::string d_description
std::string getFullDescription() const override
returns a fuller text description
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
bool Match(const DataFuncArgType what) const override
const MatchFuncArgType getLower() const
returns our lower bound
const MatchFuncArgType getUpper() const
returns our upper bound
std::pair< bool, bool > getEndsOpen() const
returns the state of our ends (open or not)
const MatchFuncArgType getTol() const
returns our tolerance
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 override
returns a copy of this Query
#define RDKIT_QUERY_EXPORT
int queryCmp(const T1 v1, const T2 v2, const T1 tol)