Base class for all queries. More...
#include <Query.h>
Public Types | |
| typedef boost::shared_ptr < Query< MatchFuncArgType, DataFuncArgType, needsConversion > > | CHILD_TYPE |
| typedef std::vector< CHILD_TYPE > | CHILD_VECT |
| typedef CHILD_VECT::iterator | CHILD_VECT_I |
| typedef CHILD_VECT::const_iterator | CHILD_VECT_CI |
Public Member Functions | |
| 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 (std::string &descr) |
| sets our text description | |
| void | setDescription (const char *descr) |
| std::string | getDescription () const |
| returns our text description | |
| 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 | |
| virtual bool | Match (const DataFuncArgType arg) const |
| returns whether or not we match the argument | |
| virtual Query < MatchFuncArgType, DataFuncArgType, needsConversion > * | copy () const |
| returns a copy of this Query | |
Public Attributes | |
| bool(*)(MatchFuncArgType) | getMatchFunc () const |
| returns our match function: | |
| MatchFuncArgType(*)(DataFuncArgType) | getDataFunc () const |
| returns our data function: | |
Protected Member Functions | |
| MatchFuncArgType | TypeConvert (MatchFuncArgType what, Int2Type< false > d) const |
calls our dataFunc (if it's set) on what and returns the result, otherwise returns what | |
| MatchFuncArgType | TypeConvert (DataFuncArgType what, Int2Type< true > d) const |
calls our dataFunc (which must be set) on what and returns the result | |
Protected Attributes | |
| std::string | d_description |
| CHILD_VECT | d_children |
| bool | df_negate |
| bool(* | d_matchFunc )(MatchFuncArgType) |
| MatchFuncArgType(* | d_dataFunc )(DataFuncArgType) |
Base class for all queries.
Query objects have one or two functions associated with them:
bool matchFunc(MatchFuncArgType other) returns true or false to indicate whether this query matches other. This is mandatory.MatchFuncArgType dataFunc(DataFuncArgType other) converts the argument other from DataFuncArgType to MatchFuncArgType. This is optional if DataFuncArgType is the same as (or implicitly convertible to) MatchFuncArgType. Definition at line 46 of file Query.h.
| typedef boost::shared_ptr< Query<MatchFuncArgType, DataFuncArgType, needsConversion> > Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::CHILD_TYPE |
| typedef std::vector< CHILD_TYPE > Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::CHILD_VECT |
| typedef CHILD_VECT::const_iterator Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::CHILD_VECT_CI |
| typedef CHILD_VECT::iterator Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::CHILD_VECT_I |
| Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::Query | ( | ) | [inline] |
| virtual Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::~Query | ( | ) | [inline, virtual] |
| void Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::addChild | ( | CHILD_TYPE | child | ) | [inline] |
adds a child to our list of children
Definition at line 79 of file Query.h.
Referenced by Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::Query< int, ConstAtomPtr, needsConversion >::copy(), Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), and Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy().
| CHILD_VECT_CI Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::beginChildren | ( | ) | const [inline] |
returns an iterator for the beginning of our child vector
Definition at line 81 of file Query.h.
Referenced by Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::Query< int, ConstAtomPtr, needsConversion >::copy(), Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), and Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match().
| virtual Query<MatchFuncArgType,DataFuncArgType,needsConversion>* Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::copy | ( | ) | const [inline, virtual] |
returns a copy of this Query
Notes:
deleteing the result Reimplemented in RDKit::AtomRingQuery, RDKit::RecursiveStructureQuery, Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::EqualityQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::SetQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::EqualityQuery< int, ConstAtomPtr, true >, and Queries::SetQuery< int, Atom const *, true >.
| CHILD_VECT_CI Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::endChildren | ( | ) | const [inline] |
returns an iterator for the end of our child vector
Definition at line 83 of file Query.h.
Referenced by Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::Query< int, ConstAtomPtr, needsConversion >::copy(), Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), and Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match().
| std::string Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::getDescription | ( | ) | const [inline] |
| bool Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::getNegation | ( | ) | const [inline] |
returns whether or not we are negated
Definition at line 60 of file Query.h.
Referenced by Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::SetQuery< int, Atom const *, true >::copy(), Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), RDKit::RecursiveStructureQuery::copy(), RDKit::AtomRingQuery::copy(), Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::EqualityQuery< int, ConstAtomPtr, true >::copy(), Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), Queries::SetQuery< int, Atom const *, true >::Match(), Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), RDKit::AtomRingQuery::Match(), Queries::Query< int, ConstAtomPtr, needsConversion >::Match(), Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), Queries::EqualityQuery< int, ConstAtomPtr, true >::Match(), and Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match().
| virtual bool Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::Match | ( | const DataFuncArgType | arg | ) | const [inline, virtual] |
returns whether or not we match the argument
Reimplemented in Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::EqualityQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::SetQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, and Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >.
| void Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::setDataFunc | ( | MatchFuncArgType(*)(DataFuncArgType) | what | ) | [inline] |
sets our data function
Definition at line 74 of file Query.h.
Referenced by RDKit::AtomRingQuery::AtomRingQuery(), Queries::SetQuery< int, Atom const *, true >::copy(), Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::EqualityQuery< int, ConstAtomPtr, true >::copy(), and RDKit::RecursiveStructureQuery::RecursiveStructureQuery().
| void Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::setDescription | ( | const char * | descr | ) | [inline] |
| void Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::setDescription | ( | std::string & | descr | ) | [inline] |
sets our text description
Definition at line 63 of file Query.h.
Referenced by RDKit::AtomRingQuery::AtomRingQuery(), and RDKit::RecursiveStructureQuery::RecursiveStructureQuery().
| void Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::setMatchFunc | ( | bool(*)(MatchFuncArgType) | what | ) | [inline] |
| void Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::setNegation | ( | bool | what | ) | [inline] |
sets whether or not we are negated
Definition at line 58 of file Query.h.
Referenced by Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::SetQuery< int, Atom const *, true >::copy(), Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), RDKit::RecursiveStructureQuery::copy(), RDKit::AtomRingQuery::copy(), Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::EqualityQuery< int, ConstAtomPtr, true >::copy(), and Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy().
| MatchFuncArgType Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::TypeConvert | ( | MatchFuncArgType | what, | |
| Int2Type< false > | d | |||
| ) | const [inline, protected] |
calls our dataFunc (if it's set) on what and returns the result, otherwise returns what
Definition at line 127 of file Query.h.
Referenced by Queries::SetQuery< int, Atom const *, true >::Match(), Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), RDKit::AtomRingQuery::Match(), Queries::Query< int, ConstAtomPtr, needsConversion >::Match(), Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), and Queries::EqualityQuery< int, ConstAtomPtr, true >::Match().
| MatchFuncArgType Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::TypeConvert | ( | DataFuncArgType | what, | |
| Int2Type< true > | d | |||
| ) | const [inline, protected] |
CHILD_VECT Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::d_children [protected] |
Definition at line 120 of file Query.h.
Referenced by Queries::Query< int, ConstAtomPtr, needsConversion >::addChild(), Queries::Query< int, ConstAtomPtr, needsConversion >::beginChildren(), Queries::Query< int, ConstAtomPtr, needsConversion >::endChildren(), and Queries::Query< int, ConstAtomPtr, needsConversion >::~Query().
MatchFuncArgType(* Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::d_dataFunc)(DataFuncArgType) [protected] |
Definition at line 123 of file Query.h.
Referenced by Queries::SetQuery< int, Atom const *, true >::copy(), Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), RDKit::AtomRingQuery::copy(), Queries::Query< int, ConstAtomPtr, needsConversion >::copy(), Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::EqualityQuery< int, ConstAtomPtr, true >::copy(), Queries::Query< int, ConstAtomPtr, needsConversion >::setDataFunc(), and Queries::Query< int, ConstAtomPtr, needsConversion >::TypeConvert().
std::string Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::d_description [protected] |
Definition at line 116 of file Query.h.
Referenced by Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::SetQuery< int, Atom const *, true >::copy(), Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), RDKit::RecursiveStructureQuery::copy(), RDKit::AtomRingQuery::copy(), Queries::Query< int, ConstAtomPtr, needsConversion >::copy(), Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::EqualityQuery< int, ConstAtomPtr, true >::copy(), Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::Query< int, ConstAtomPtr, needsConversion >::getDescription(), and Queries::Query< int, ConstAtomPtr, needsConversion >::setDescription().
bool(* Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::d_matchFunc)(MatchFuncArgType) [protected] |
Definition at line 122 of file Query.h.
Referenced by Queries::Query< int, ConstAtomPtr, needsConversion >::copy(), Queries::Query< int, ConstAtomPtr, needsConversion >::Match(), and Queries::Query< int, ConstAtomPtr, needsConversion >::setMatchFunc().
bool Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::df_negate [protected] |
Definition at line 121 of file Query.h.
Referenced by Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::AndQuery(), Queries::Query< int, ConstAtomPtr, needsConversion >::copy(), Queries::EqualityQuery< int, ConstAtomPtr, true >::EqualityQuery(), Queries::Query< int, ConstAtomPtr, needsConversion >::getNegation(), Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::GreaterEqualQuery(), Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::GreaterQuery(), Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::LessEqualQuery(), Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::LessQuery(), Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::OrQuery(), Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::RangeQuery(), Queries::Query< int, ConstAtomPtr, needsConversion >::setNegation(), and Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::XOrQuery().
MatchFuncArgType(*)(DataFuncArgType) Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::getDataFunc() const [inline] |
bool(*)(MatchFuncArgType) Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::getMatchFunc() const [inline] |
1.7.1