37 this->expandQuery(makeAtomIsotopeQuery(other.getIsotope()),
38 Queries::CompositeQueryType::COMPOSITE_AND);
41 this->expandQuery(makeAtomFormalChargeQuery(other.getFormalCharge()),
42 Queries::CompositeQueryType::COMPOSITE_AND);
46 makeAtomNumRadicalElectronsQuery(other.getNumRadicalElectrons()),
47 Queries::CompositeQueryType::COMPOSITE_AND);
52 dp_query = other.dp_query->copy();
61 Atom::operator=(other);
64 dp_query = other.dp_query->
copy();
72 dp_query = std::exchange(other.dp_query,
nullptr);
78 QueryAtom::operator=(std::move(other));
79 dp_query = std::exchange(other.dp_query,
nullptr);
89 bool hasQuery()
const override {
return dp_query !=
nullptr; }
92 std::string
getQueryType()
const override {
return dp_query->getTypeLabel(); }
121 bool maintainOrder =
true)
override;
136 std::string res =
"";
138 for (
unsigned int i = 0; i < depth; ++i) {
142 for (
const auto &child :
144 res +=
qhelper(child.get(), depth + 1);
152 std::string res =
"";
Defines the Atom class and associated typedefs.
#define PRECONDITION(expr, mess)
Pulls in all the query types.
Base class for all queries.
virtual std::string getFullDescription() const
returns a fuller text description
CHILD_VECT_CI endChildren() const
returns an iterator for the end of our child vector
CHILD_VECT_CI beginChildren() const
returns an iterator for the beginning of our child vector
virtual Query< MatchFuncArgType, DataFuncArgType, needsConversion > * copy() const
returns a copy of this Query
The class for representing atoms.
unsigned int getNumRadicalElectrons() const
returns the number of radical electrons for this Atom
virtual bool hasQuery() const
int getFormalCharge() const
returns the formal charge of this atom
unsigned int getIsotope() const
returns our isotope number
virtual QUERYATOM_QUERY * getQuery() const
NOT CALLABLE.
Class for storing atomic queries.
bool hasQuery() const override
bool QueryMatch(QueryAtom const *what) const
returns true if our query details match those of QueryAtom what
QueryAtom & operator=(const QueryAtom &other)
void setQuery(QUERYATOM_QUERY *what) override
replaces our current query with the value passed in
QueryAtom(QueryAtom &&other) noexcept
Queries::Query< int, Atom const *, true > QUERYATOM_QUERY
bool Match(Atom const *what) const override
returns true if we match Atom what
QueryAtom & operator=(QueryAtom &&other) noexcept
QueryAtom(const QueryAtom &other)
QueryAtom(const Atom &other)
void expandQuery(QUERYATOM_QUERY *what, Queries::CompositeQueryType how=Queries::COMPOSITE_AND, bool maintainOrder=true) override
expands our current query
std::string getQueryType() const override
returns the label associated to this query
QUERYATOM_QUERY * getQuery() const override
returns our current query
Atom * copy() const override
returns a copy of this query, owned by the caller
#define RDKIT_GRAPHMOL_EXPORT
std::string qhelper(const Atom::QUERYATOM_QUERY *q, unsigned int depth)
std::string describeQuery(const Atom *atom)
T * makeAtomNumQuery(int what, const std::string &descr)
returns a Query for matching atomic number