 |
RDKit
Open-source cheminformatics and machine learning.
|
Go to the documentation of this file.
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> {
35 RangeQuery(MatchFuncArgType lower, MatchFuncArgType upper)
62 const MatchFuncArgType
getTol()
const {
return this->
d_tol; };
64 bool Match(
const DataFuncArgType what)
const {
65 MatchFuncArgType mfArg =
69 bool lowerRes, upperRes;
79 bool tempR = !(lowerRes && upperRes);
100 std::ostringstream res;
const MatchFuncArgType getLower() const
returns our lower bound
Query< MatchFuncArgType, DataFuncArgType, needsConversion > * copy() const
void setNegation(bool what)
sets whether or not we are negated
int queryCmp(const T1 v1, const T2 v2, const T1 tol)
MatchFuncArgType(* d_dataFunc)(MatchFuncArgType)
std::string getFullDescription() const
const MatchFuncArgType getUpper() const
returns our upper bound
a Query implementing a range: arguments must fall in a particular range of values.
void setEndsOpen(bool lower, bool upper)
sets whether or not the ends of the range are open
void setUpper(MatchFuncArgType what)
sets our upper bound
std::string d_description
void setTol(MatchFuncArgType what)
sets our tolerance
void setDataFunc(MatchFuncArgType(*what)(MatchFuncArgType))
sets our data function
bool Match(const DataFuncArgType what) const
bool getNegation() const
returns whether or not we are negated
class to allow integer values to pick templates
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
RangeQuery(MatchFuncArgType lower, MatchFuncArgType upper)
construct and set the lower and upper bounds
Base class for all queries.
const std::string & getDescription() const
returns our text description
void setLower(MatchFuncArgType what)
sets our lower bound
const MatchFuncArgType getTol() const
returns our tolerance