36 dp_query = other.getQuery()->copy();
38 dp_query = makeAtomNumQuery(other.getAtomicNum());
40 if (other.getIsotope()) {
41 this->expandQuery(makeAtomIsotopeQuery(other.getIsotope()),
42 Queries::CompositeQueryType::COMPOSITE_AND);
45 this->expandQuery(makeAtomFormalChargeQuery(other.getFormalCharge()),
46 Queries::CompositeQueryType::COMPOSITE_AND);
50 makeAtomNumRadicalElectronsQuery(other.getNumRadicalElectrons()),
51 Queries::CompositeQueryType::COMPOSITE_AND);
57 dp_query = other.dp_query->copy();
69 dp_query = other.dp_query->
copy();
77 dp_query = std::exchange(other.dp_query,
nullptr);
84 dp_query = std::exchange(other.dp_query,
nullptr);
94 bool hasQuery()
const override {
return dp_query !=
nullptr; }
97 std::string
getQueryType()
const override {
return dp_query->getTypeLabel(); }
126 bool maintainOrder =
true)
override;
141 std::string res =
"";
143 for (
unsigned int i = 0; i < depth; ++i) {
147 for (
const auto &child :
149 res +=
qhelper(child.get(), depth + 1);
157 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.
Atom & operator=(const Atom &other)
Queries::Query< int, Atom const *, true > QUERYATOM_QUERY
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
virtual QUERYATOM_QUERY * getQuery() const
returns nullptr
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
bool Match(Atom const *what) const override
returns true if we match Atom what
Queries::Query< int, Atom const *, true > QUERYATOM_QUERY
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)
RDKIT_GRAPHMOL_EXPORT bool hasUninitializedRecursiveQuery(const Atom &atom)
std::string describeQuery(const Atom *atom)
RDKIT_GRAPHMOL_EXPORT bool hasRecursiveQuery(const Atom &atom)
T * makeAtomNumQuery(int what, const std::string &descr)
returns a Query for matching atomic number