RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion > Class Template Reference

a Query implementing a range: arguments must fall in a particular range of values. More...

#include <RangeQuery.h>

Inheritance diagram for Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >:
Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >

Public Member Functions

 RangeQuery ()
 
 RangeQuery (MatchFuncArgType lower, MatchFuncArgType upper)
 construct and set the lower and upper bounds
 
void setUpper (MatchFuncArgType what)
 sets our upper bound
 
const MatchFuncArgType getUpper () const
 returns our upper bound
 
void setLower (MatchFuncArgType what)
 sets our lower bound
 
const MatchFuncArgType getLower () const
 returns our lower bound
 
void setEndsOpen (bool lower, bool upper)
 sets whether or not the ends of the range are open
 
std::pair< bool, bool > getEndsOpen () const
 returns the state of our ends (open or not)
 
void setTol (MatchFuncArgType what)
 sets our tolerance
 
const MatchFuncArgType getTol () const
 returns our tolerance
 
bool Match (const DataFuncArgType what) const override
 returns whether or not we match the argument
 
Query< MatchFuncArgType, DataFuncArgType, needsConversion > * copy () const override
 returns a copy of this Query
 
std::string getFullDescription () const override
 returns a fuller text description
 
- Public Member Functions inherited from Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >
 Query ()
 
virtual ~Query ()
 
void setNegation (bool what)
 sets whether or not we are negated
 
bool getNegation () const
 returns whether or not we are negated
 
void setDescription (const std::string &descr)
 sets our text description
 
void setDescription (const char *descr)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
const std::string & getDescription () const
 returns our text description
 
void setTypeLabel (const std::string &typ)
 sets our type label
 
void setTypeLabel (const char *typ)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
const std::string & getTypeLabel () const
 returns our text label.
 
void setMatchFunc (bool(*what)(MatchFuncArgType))
 sets our match function
 
void setDataFunc (MatchFuncArgType(*what)(DataFuncArgType))
 sets our data function
 
void addChild (CHILD_TYPE child)
 adds a child to our list of children
 
CHILD_VECT_CI beginChildren () const
 returns an iterator for the beginning of our child vector
 
CHILD_VECT_CI endChildren () const
 returns an iterator for the end of our child vector
 

Protected Attributes

MatchFuncArgType d_upper
 
MatchFuncArgType d_lower
 
bool df_upperOpen {true}
 
bool df_lowerOpen {true}
 
- Protected Attributes inherited from Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >
MatchFuncArgType d_val = 0
 
MatchFuncArgType d_tol = 0
 
std::string d_description = ""
 
std::string d_queryType = ""
 
CHILD_VECT d_children
 
bool df_negate {false}
 
bool(* d_matchFunc )(MatchFuncArgType)
 
union { 
 
   MatchFuncArgType(*   d_dataFunc )(DataFuncArgType) 
 
   MatchFuncArgType(*   d_dataFuncSameType )(MatchFuncArgType) 
 
};  
 

Additional Inherited Members

- Public Types inherited from Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >
using CHILD_TYPE = std::shared_ptr< Query< MatchFuncArgType, DataFuncArgType, needsConversion > >
 
using CHILD_VECT = std::vector< CHILD_TYPE >
 
using CHILD_VECT_I = typename CHILD_VECT::iterator
 
using CHILD_VECT_CI = typename CHILD_VECT::const_iterator
 
using MATCH_FUNC_ARG_TYPE = MatchFuncArgType
 
using DATA_FUNC_ARG_TYPE = DataFuncArgType
 
- Public Attributes inherited from Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >
bool(*)(MatchFuncArgType) getMatchFunc () const
 returns our match function:
 
MatchFuncArgType(*)(DataFuncArgType) getDataFunc () const
 returns our data function:
 
- Protected Member Functions inherited from Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >
MatchFuncArgType TypeConvert (MatchFuncArgType what, Int2Type< false >) const
 calls our dataFunc (if it's set) on what and returns the result, otherwise returns what
 
MatchFuncArgType TypeConvert (DataFuncArgType what, Int2Type< true >) const
 

Detailed Description

template<class MatchFuncArgType, class DataFuncArgType = MatchFuncArgType, bool needsConversion = false>
class Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >

a Query implementing a range: arguments must fall in a particular range of values.

The ends of the range default to be open, but they can individually set to be closed.

There is also an optional tolerance to be used in comparisons

Definition at line 27 of file RangeQuery.h.

Constructor & Destructor Documentation

◆ RangeQuery() [1/2]

template<class MatchFuncArgType , class DataFuncArgType = MatchFuncArgType, bool needsConversion = false>
Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::RangeQuery ( )
inline

Definition at line 30 of file RangeQuery.h.

◆ RangeQuery() [2/2]

template<class MatchFuncArgType , class DataFuncArgType = MatchFuncArgType, bool needsConversion = false>
Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::RangeQuery ( MatchFuncArgType  lower,
MatchFuncArgType  upper 
)
inline

construct and set the lower and upper bounds

Definition at line 32 of file RangeQuery.h.

Member Function Documentation

◆ copy()

◆ getEndsOpen()

template<class MatchFuncArgType , class DataFuncArgType = MatchFuncArgType, bool needsConversion = false>
std::pair< bool, bool > Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::getEndsOpen ( ) const
inline

returns the state of our ends (open or not)

Definition at line 52 of file RangeQuery.h.

◆ getFullDescription()

template<class MatchFuncArgType , class DataFuncArgType = MatchFuncArgType, bool needsConversion = false>
std::string Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::getFullDescription ( ) const
inlineoverridevirtual

returns a fuller text description

Reimplemented from Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >.

Definition at line 101 of file RangeQuery.h.

◆ getLower()

template<class MatchFuncArgType , class DataFuncArgType = MatchFuncArgType, bool needsConversion = false>
const MatchFuncArgType Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::getLower ( ) const
inline

returns our lower bound

Definition at line 44 of file RangeQuery.h.

◆ getTol()

template<class MatchFuncArgType , class DataFuncArgType = MatchFuncArgType, bool needsConversion = false>
const MatchFuncArgType Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::getTol ( ) const
inline

returns our tolerance

Definition at line 59 of file RangeQuery.h.

◆ getUpper()

template<class MatchFuncArgType , class DataFuncArgType = MatchFuncArgType, bool needsConversion = false>
const MatchFuncArgType Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::getUpper ( ) const
inline

returns our upper bound

Definition at line 40 of file RangeQuery.h.

◆ Match()

template<class MatchFuncArgType , class DataFuncArgType = MatchFuncArgType, bool needsConversion = false>
bool Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match ( const DataFuncArgType  arg) const
inlineoverridevirtual

returns whether or not we match the argument

Reimplemented from Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >.

Definition at line 61 of file RangeQuery.h.

References Queries::queryCmp().

◆ setEndsOpen()

template<class MatchFuncArgType , class DataFuncArgType = MatchFuncArgType, bool needsConversion = false>
void Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::setEndsOpen ( bool  lower,
bool  upper 
)
inline

sets whether or not the ends of the range are open

Definition at line 47 of file RangeQuery.h.

Referenced by Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy().

◆ setLower()

template<class MatchFuncArgType , class DataFuncArgType = MatchFuncArgType, bool needsConversion = false>
void Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::setLower ( MatchFuncArgType  what)
inline

sets our lower bound

Definition at line 42 of file RangeQuery.h.

Referenced by Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy().

◆ setTol()

template<class MatchFuncArgType , class DataFuncArgType = MatchFuncArgType, bool needsConversion = false>
void Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::setTol ( MatchFuncArgType  what)
inline

sets our tolerance

Definition at line 57 of file RangeQuery.h.

Referenced by Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy().

◆ setUpper()

template<class MatchFuncArgType , class DataFuncArgType = MatchFuncArgType, bool needsConversion = false>
void Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::setUpper ( MatchFuncArgType  what)
inline

sets our upper bound

Definition at line 38 of file RangeQuery.h.

Referenced by Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy().

Member Data Documentation

◆ d_lower

template<class MatchFuncArgType , class DataFuncArgType = MatchFuncArgType, bool needsConversion = false>
MatchFuncArgType Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::d_lower
protected

Definition at line 112 of file RangeQuery.h.

◆ d_upper

template<class MatchFuncArgType , class DataFuncArgType = MatchFuncArgType, bool needsConversion = false>
MatchFuncArgType Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::d_upper
protected

Definition at line 112 of file RangeQuery.h.

◆ df_lowerOpen

template<class MatchFuncArgType , class DataFuncArgType = MatchFuncArgType, bool needsConversion = false>
bool Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::df_lowerOpen {true}
protected

Definition at line 113 of file RangeQuery.h.

◆ df_upperOpen

template<class MatchFuncArgType , class DataFuncArgType = MatchFuncArgType, bool needsConversion = false>
bool Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::df_upperOpen {true}
protected

Definition at line 113 of file RangeQuery.h.


The documentation for this class was generated from the following file: