mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-03 21:44:30 +08:00
Run clang-tidy (modernize-use-override) (#4251)
This commit is contained in:
@@ -175,7 +175,7 @@ class HierarchCatalog : public Catalog<entryType, paramType> {
|
||||
}
|
||||
|
||||
//------------------------------------
|
||||
~HierarchCatalog() { destroy(); }
|
||||
~HierarchCatalog() override { destroy(); }
|
||||
|
||||
//------------------------------------
|
||||
//! serializes this object to a stream
|
||||
@@ -225,7 +225,7 @@ class HierarchCatalog : public Catalog<entryType, paramType> {
|
||||
|
||||
//------------------------------------
|
||||
//! serializes this object and returns the resulting \c pickle
|
||||
std::string Serialize() const {
|
||||
std::string Serialize() const override {
|
||||
std::stringstream ss(std::ios_base::binary | std::ios_base::out |
|
||||
std::ios_base::in);
|
||||
this->toStream(ss);
|
||||
@@ -282,7 +282,7 @@ class HierarchCatalog : public Catalog<entryType, paramType> {
|
||||
}
|
||||
|
||||
//------------------------------------
|
||||
unsigned int getNumEntries() const {
|
||||
unsigned int getNumEntries() const override {
|
||||
return static_cast<unsigned int>(boost::num_vertices(d_graph));
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ class HierarchCatalog : public Catalog<entryType, paramType> {
|
||||
fingerprint length will also be updated.
|
||||
|
||||
*/
|
||||
unsigned int addEntry(entryType *entry, bool updateFPLength = true) {
|
||||
unsigned int addEntry(entryType *entry, bool updateFPLength = true) override {
|
||||
PRECONDITION(entry, "bad arguments");
|
||||
if (updateFPLength) {
|
||||
unsigned int fpl = this->getFPLength();
|
||||
@@ -357,7 +357,7 @@ class HierarchCatalog : public Catalog<entryType, paramType> {
|
||||
|
||||
//------------------------------------
|
||||
//! returns a pointer to our entry with a particular index
|
||||
const entryType *getEntryWithIdx(unsigned int idx) const {
|
||||
const entryType *getEntryWithIdx(unsigned int idx) const override {
|
||||
URANGE_CHECK(idx, getNumEntries());
|
||||
int vd = static_cast<int>(boost::vertex(idx, d_graph));
|
||||
typename boost::property_map<CatalogGraph, vertex_entry_t>::const_type
|
||||
|
||||
@@ -50,19 +50,19 @@ class RDKIT_CHEMICALFEATURES_EXPORT FreeChemicalFeature
|
||||
d_type(other.getType()),
|
||||
d_position(other.getPos()) {}
|
||||
|
||||
~FreeChemicalFeature() {}
|
||||
~FreeChemicalFeature() override {}
|
||||
|
||||
//! return our id
|
||||
int getId() const { return d_id; }
|
||||
int getId() const override { return d_id; }
|
||||
|
||||
//! return our family
|
||||
const std::string &getFamily() const { return d_family; }
|
||||
const std::string &getFamily() const override { return d_family; }
|
||||
|
||||
//! return our type
|
||||
const std::string &getType() const { return d_type; }
|
||||
const std::string &getType() const override { return d_type; }
|
||||
|
||||
//! return our position
|
||||
RDGeom::Point3D getPos() const { return d_position; }
|
||||
RDGeom::Point3D getPos() const override { return d_position; }
|
||||
|
||||
//! set our id
|
||||
void setId(const int id) { d_id = id; }
|
||||
|
||||
@@ -22,7 +22,7 @@ class RDKIT_DATASTRUCTS_EXPORT DatastructsException : public std::exception {
|
||||
DatastructsException(std::string msg) : _msg(std::move(msg)) {}
|
||||
//! get the error message
|
||||
const char *what() const noexcept override { return _msg.c_str(); }
|
||||
~DatastructsException() noexcept {}
|
||||
~DatastructsException() noexcept override {}
|
||||
|
||||
private:
|
||||
std::string _msg;
|
||||
|
||||
@@ -38,12 +38,12 @@
|
||||
namespace RDKit {
|
||||
class DataStructsExplicitBitVecPropHandler : public CustomPropHandler {
|
||||
public:
|
||||
const char *getPropName() const { return "ExplicitBVProp"; }
|
||||
bool canSerialize(const RDValue &value) const {
|
||||
const char *getPropName() const override { return "ExplicitBVProp"; }
|
||||
bool canSerialize(const RDValue &value) const override {
|
||||
return rdvalue_is<ExplicitBitVect>(value);
|
||||
}
|
||||
|
||||
bool read(std::istream &ss, RDValue &value) const {
|
||||
bool read(std::istream &ss, RDValue &value) const override {
|
||||
std::string v;
|
||||
int version = 0;
|
||||
streamRead(ss, v, version);
|
||||
@@ -52,7 +52,7 @@ class DataStructsExplicitBitVecPropHandler : public CustomPropHandler {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool write(std::ostream &ss, const RDValue &value) const {
|
||||
bool write(std::ostream &ss, const RDValue &value) const override {
|
||||
try {
|
||||
std::string output =
|
||||
rdvalue_cast<const ExplicitBitVect &>(value).toString();
|
||||
@@ -63,7 +63,7 @@ class DataStructsExplicitBitVecPropHandler : public CustomPropHandler {
|
||||
}
|
||||
}
|
||||
|
||||
CustomPropHandler *clone() const {
|
||||
CustomPropHandler *clone() const override {
|
||||
return new DataStructsExplicitBitVecPropHandler;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -48,13 +48,13 @@ class RDKIT_DATASTRUCTS_EXPORT ExplicitBitVect : public BitVect {
|
||||
d_size(static_cast<unsigned int>(bits->size())),
|
||||
d_numOnBits(static_cast<unsigned int>(bits->count())) {}
|
||||
|
||||
~ExplicitBitVect();
|
||||
~ExplicitBitVect() override;
|
||||
|
||||
ExplicitBitVect &operator=(const ExplicitBitVect &other);
|
||||
bool operator[](const unsigned int which) const;
|
||||
bool setBit(const unsigned int which);
|
||||
bool unsetBit(const unsigned int which);
|
||||
bool getBit(const unsigned int which) const;
|
||||
bool operator[](const unsigned int which) const override;
|
||||
bool setBit(const unsigned int which) override;
|
||||
bool unsetBit(const unsigned int which) override;
|
||||
bool getBit(const unsigned int which) const override;
|
||||
|
||||
ExplicitBitVect operator^(const ExplicitBitVect &other) const;
|
||||
ExplicitBitVect operator&(const ExplicitBitVect &other) const;
|
||||
@@ -69,14 +69,14 @@ class RDKIT_DATASTRUCTS_EXPORT ExplicitBitVect : public BitVect {
|
||||
/* concatenate two ExplicitBitVects */
|
||||
ExplicitBitVect &operator+=(const ExplicitBitVect &other);
|
||||
|
||||
unsigned int getNumBits() const;
|
||||
unsigned int getNumOnBits() const;
|
||||
unsigned int getNumOffBits() const;
|
||||
unsigned int getNumBits() const override;
|
||||
unsigned int getNumOnBits() const override;
|
||||
unsigned int getNumOffBits() const override;
|
||||
|
||||
void getOnBits(IntVect &v) const;
|
||||
void getOnBits(IntVect &v) const override;
|
||||
|
||||
void clearBits() { dp_bits->reset(); }
|
||||
std::string toString() const;
|
||||
void clearBits() override { dp_bits->reset(); }
|
||||
std::string toString() const override;
|
||||
|
||||
boost::dynamic_bitset<> *dp_bits{nullptr}; //!< our raw storage
|
||||
|
||||
@@ -90,7 +90,7 @@ class RDKIT_DATASTRUCTS_EXPORT ExplicitBitVect : public BitVect {
|
||||
private:
|
||||
unsigned int d_size{0};
|
||||
unsigned int d_numOnBits{0};
|
||||
void _initForSize(const unsigned int size);
|
||||
void _initForSize(const unsigned int size) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -53,9 +53,9 @@ class RDKIT_DATASTRUCTS_EXPORT SparseBitVect : public BitVect {
|
||||
SparseBitVect(const char *data, const unsigned int dataLen);
|
||||
|
||||
SparseBitVect &operator=(const SparseBitVect &);
|
||||
~SparseBitVect() { delete dp_bits; }
|
||||
~SparseBitVect() override { delete dp_bits; }
|
||||
|
||||
bool operator[](const unsigned int which) const;
|
||||
bool operator[](const unsigned int which) const override;
|
||||
SparseBitVect operator|(const SparseBitVect &) const;
|
||||
SparseBitVect operator&(const SparseBitVect &) const;
|
||||
SparseBitVect operator^(const SparseBitVect &) const;
|
||||
@@ -64,25 +64,25 @@ class RDKIT_DATASTRUCTS_EXPORT SparseBitVect : public BitVect {
|
||||
//! returns a (const) pointer to our raw storage
|
||||
const IntSet *getBitSet() const { return dp_bits; }
|
||||
|
||||
unsigned int getNumBits() const { return d_size; }
|
||||
bool setBit(const unsigned int which);
|
||||
unsigned int getNumBits() const override { return d_size; }
|
||||
bool setBit(const unsigned int which) override;
|
||||
bool setBit(const IntSetIter which);
|
||||
bool unsetBit(const unsigned int which);
|
||||
bool getBit(const unsigned int which) const;
|
||||
bool unsetBit(const unsigned int which) override;
|
||||
bool getBit(const unsigned int which) const override;
|
||||
bool getBit(const IntVectIter which) const;
|
||||
bool getBit(const IntSetIter which) const;
|
||||
|
||||
unsigned int getNumOnBits() const {
|
||||
unsigned int getNumOnBits() const override {
|
||||
return static_cast<unsigned int>(dp_bits->size());
|
||||
}
|
||||
unsigned int getNumOffBits() const {
|
||||
unsigned int getNumOffBits() const override {
|
||||
return d_size - static_cast<unsigned int>(dp_bits->size());
|
||||
}
|
||||
|
||||
std::string toString() const;
|
||||
std::string toString() const override;
|
||||
|
||||
void getOnBits(IntVect &v) const;
|
||||
void clearBits() { dp_bits->clear(); }
|
||||
void getOnBits(IntVect &v) const override;
|
||||
void clearBits() override { dp_bits->clear(); }
|
||||
IntSet *dp_bits{
|
||||
nullptr}; //!< our raw data, exposed for the sake of efficiency
|
||||
|
||||
@@ -95,7 +95,7 @@ class RDKIT_DATASTRUCTS_EXPORT SparseBitVect : public BitVect {
|
||||
|
||||
private:
|
||||
unsigned int d_size{0};
|
||||
void _initForSize(const unsigned int size);
|
||||
void _initForSize(const unsigned int size) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -31,12 +31,12 @@ class RDKIT_DISTGEOMETRY_EXPORT ChiralViolationContrib
|
||||
double weight = 1.0);
|
||||
|
||||
//! return the contribution of this contrib to the energy of a given state
|
||||
double getEnergy(double *pos) const;
|
||||
double getEnergy(double *pos) const override;
|
||||
|
||||
//! calculate the contribution of this contrib to the gradient at a given
|
||||
// state
|
||||
void getGrad(double *pos, double *grad) const;
|
||||
virtual ChiralViolationContrib *copy() const {
|
||||
void getGrad(double *pos, double *grad) const override;
|
||||
ChiralViolationContrib *copy() const override {
|
||||
return new ChiralViolationContrib(*this);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,10 +34,10 @@ class RDKIT_DISTGEOMETRY_EXPORT DistViolationContrib
|
||||
unsigned int idx2, double ub, double lb,
|
||||
double weight = 1.0);
|
||||
|
||||
double getEnergy(double *pos) const;
|
||||
double getEnergy(double *pos) const override;
|
||||
|
||||
void getGrad(double *pos, double *grad) const;
|
||||
virtual DistViolationContrib *copy() const {
|
||||
void getGrad(double *pos, double *grad) const override;
|
||||
DistViolationContrib *copy() const override {
|
||||
return new DistViolationContrib(*this);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class RDKIT_DISTGEOMETRY_EXPORT FourthDimContrib
|
||||
}
|
||||
|
||||
//! return the contribution of this contrib to the energy of a given state
|
||||
double getEnergy(double *pos) const {
|
||||
double getEnergy(double *pos) const override {
|
||||
PRECONDITION(dp_forceField, "no owner");
|
||||
PRECONDITION(dp_forceField->dimension() == 4,
|
||||
"force field has wrong dimension");
|
||||
@@ -44,7 +44,7 @@ class RDKIT_DISTGEOMETRY_EXPORT FourthDimContrib
|
||||
|
||||
//! calculate the contribution of this contrib to the gradient at a given
|
||||
// state
|
||||
void getGrad(double *pos, double *grad) const {
|
||||
void getGrad(double *pos, double *grad) const override {
|
||||
PRECONDITION(dp_forceField, "no owner");
|
||||
PRECONDITION(dp_forceField->dimension() == 4,
|
||||
"force field has wrong dimension");
|
||||
@@ -52,7 +52,9 @@ class RDKIT_DISTGEOMETRY_EXPORT FourthDimContrib
|
||||
unsigned int pid = d_idx * dp_forceField->dimension() + 3;
|
||||
grad[pid] += d_weight * pos[pid];
|
||||
}
|
||||
virtual FourthDimContrib *copy() const { return new FourthDimContrib(*this); }
|
||||
FourthDimContrib *copy() const override {
|
||||
return new FourthDimContrib(*this);
|
||||
}
|
||||
|
||||
private:
|
||||
unsigned int d_idx{0};
|
||||
|
||||
@@ -40,9 +40,11 @@ class RDKIT_FORCEFIELD_EXPORT AngleBendContrib : public ForceFieldContrib {
|
||||
AngleBendContrib(ForceField *owner, unsigned int idx1, unsigned int idx2,
|
||||
unsigned int idx3, const MMFFAngle *mmffAngleParams,
|
||||
const MMFFProp *mmffPropParamsCentralAtom);
|
||||
double getEnergy(double *pos) const;
|
||||
void getGrad(double *pos, double *grad) const;
|
||||
virtual AngleBendContrib *copy() const { return new AngleBendContrib(*this); }
|
||||
double getEnergy(double *pos) const override;
|
||||
void getGrad(double *pos, double *grad) const override;
|
||||
AngleBendContrib *copy() const override {
|
||||
return new AngleBendContrib(*this);
|
||||
}
|
||||
|
||||
private:
|
||||
bool d_isLinear;
|
||||
|
||||
@@ -43,12 +43,12 @@ class RDKIT_FORCEFIELD_EXPORT AngleConstraintContrib
|
||||
double minAngleDeg, double maxAngleDeg,
|
||||
double forceConst);
|
||||
|
||||
~AngleConstraintContrib() {}
|
||||
double getEnergy(double *pos) const;
|
||||
~AngleConstraintContrib() override {}
|
||||
double getEnergy(double *pos) const override;
|
||||
|
||||
void getGrad(double *pos, double *grad) const;
|
||||
void getGrad(double *pos, double *grad) const override;
|
||||
|
||||
virtual AngleConstraintContrib *copy() const {
|
||||
AngleConstraintContrib *copy() const override {
|
||||
return new AngleConstraintContrib(*this);
|
||||
}
|
||||
|
||||
|
||||
@@ -36,11 +36,11 @@ class RDKIT_FORCEFIELD_EXPORT BondStretchContrib : public ForceFieldContrib {
|
||||
BondStretchContrib(ForceField *owner, const unsigned int idx1,
|
||||
const unsigned int idx2, const MMFFBond *mmffBondParams);
|
||||
|
||||
double getEnergy(double *pos) const;
|
||||
double getEnergy(double *pos) const override;
|
||||
|
||||
void getGrad(double *pos, double *grad) const;
|
||||
void getGrad(double *pos, double *grad) const override;
|
||||
|
||||
virtual BondStretchContrib *copy() const {
|
||||
BondStretchContrib *copy() const override {
|
||||
return new BondStretchContrib(*this);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,14 +40,14 @@ class RDKIT_FORCEFIELD_EXPORT DistanceConstraintContrib
|
||||
unsigned int idx2, bool relative, double minLen,
|
||||
double maxLen, double forceConst);
|
||||
|
||||
~DistanceConstraintContrib() {
|
||||
~DistanceConstraintContrib() override {
|
||||
// std::cerr << " ==== Destroy constraint " << d_end1Idx << " " << d_end2Idx
|
||||
// << std::endl;
|
||||
}
|
||||
double getEnergy(double *pos) const;
|
||||
double getEnergy(double *pos) const override;
|
||||
|
||||
void getGrad(double *pos, double *grad) const;
|
||||
virtual DistanceConstraintContrib *copy() const {
|
||||
void getGrad(double *pos, double *grad) const override;
|
||||
DistanceConstraintContrib *copy() const override {
|
||||
return new DistanceConstraintContrib(*this);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,9 +34,9 @@ class RDKIT_FORCEFIELD_EXPORT VdWContrib : public ForceFieldContrib {
|
||||
*/
|
||||
VdWContrib(ForceField *owner, unsigned int idx1, unsigned int idx2,
|
||||
const MMFFVdWRijstarEps *mmffVdWConstants);
|
||||
double getEnergy(double *pos) const;
|
||||
void getGrad(double *pos, double *grad) const;
|
||||
virtual VdWContrib *copy() const { return new VdWContrib(*this); }
|
||||
double getEnergy(double *pos) const override;
|
||||
void getGrad(double *pos, double *grad) const override;
|
||||
VdWContrib *copy() const override { return new VdWContrib(*this); }
|
||||
|
||||
private:
|
||||
int d_at1Idx{-1}, d_at2Idx{-1};
|
||||
@@ -58,10 +58,10 @@ class RDKIT_FORCEFIELD_EXPORT EleContrib : public ForceFieldContrib {
|
||||
*/
|
||||
EleContrib(ForceField *owner, unsigned int idx1, unsigned int idx2,
|
||||
double chargeTerm, std::uint8_t dielModel, bool is1_4);
|
||||
double getEnergy(double *pos) const;
|
||||
void getGrad(double *pos, double *grad) const;
|
||||
double getEnergy(double *pos) const override;
|
||||
void getGrad(double *pos, double *grad) const override;
|
||||
|
||||
virtual EleContrib *copy() const { return new EleContrib(*this); }
|
||||
EleContrib *copy() const override { return new EleContrib(*this); }
|
||||
|
||||
private:
|
||||
int d_at1Idx{-1}, d_at2Idx{-1};
|
||||
|
||||
@@ -38,9 +38,9 @@ and the angle formed by atom1-atom2-atom3
|
||||
OopBendContrib(ForceField *owner, unsigned int idx1, unsigned int idx2,
|
||||
unsigned int idx3, unsigned int idx4,
|
||||
const MMFFOop *mmffOopParams);
|
||||
double getEnergy(double *pos) const;
|
||||
void getGrad(double *pos, double *grad) const;
|
||||
virtual OopBendContrib *copy() const { return new OopBendContrib(*this); }
|
||||
double getEnergy(double *pos) const override;
|
||||
void getGrad(double *pos, double *grad) const override;
|
||||
OopBendContrib *copy() const override { return new OopBendContrib(*this); }
|
||||
|
||||
private:
|
||||
int d_at1Idx{-1}, d_at2Idx{-1}, d_at3Idx{-1}, d_at4Idx{-1};
|
||||
|
||||
@@ -36,11 +36,11 @@ class RDKIT_FORCEFIELD_EXPORT PositionConstraintContrib
|
||||
PositionConstraintContrib(ForceField *owner, unsigned int idx,
|
||||
double maxDispl, double forceConst);
|
||||
|
||||
~PositionConstraintContrib() {}
|
||||
double getEnergy(double *pos) const;
|
||||
~PositionConstraintContrib() override {}
|
||||
double getEnergy(double *pos) const override;
|
||||
|
||||
void getGrad(double *pos, double *grad) const;
|
||||
virtual PositionConstraintContrib *copy() const {
|
||||
void getGrad(double *pos, double *grad) const override;
|
||||
PositionConstraintContrib *copy() const override {
|
||||
return new PositionConstraintContrib(*this);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,9 +45,9 @@ class RDKIT_FORCEFIELD_EXPORT StretchBendContrib : public ForceFieldContrib {
|
||||
const MMFFBond *mmffBondParams1,
|
||||
const MMFFBond *mmffBondParams2);
|
||||
|
||||
double getEnergy(double *pos) const;
|
||||
void getGrad(double *pos, double *grad) const;
|
||||
virtual StretchBendContrib *copy() const {
|
||||
double getEnergy(double *pos) const override;
|
||||
void getGrad(double *pos, double *grad) const override;
|
||||
StretchBendContrib *copy() const override {
|
||||
return new StretchBendContrib(*this);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,9 +44,9 @@ class RDKIT_FORCEFIELD_EXPORT TorsionAngleContrib : public ForceFieldContrib {
|
||||
TorsionAngleContrib(ForceField *owner, unsigned int idx1, unsigned int idx2,
|
||||
unsigned int idx3, unsigned int idx4,
|
||||
const MMFFTor *mmffTorParams);
|
||||
double getEnergy(double *pos) const;
|
||||
void getGrad(double *pos, double *grad) const;
|
||||
virtual TorsionAngleContrib *copy() const {
|
||||
double getEnergy(double *pos) const override;
|
||||
void getGrad(double *pos, double *grad) const override;
|
||||
TorsionAngleContrib *copy() const override {
|
||||
return new TorsionAngleContrib(*this);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,11 +45,11 @@ class RDKIT_FORCEFIELD_EXPORT TorsionConstraintContrib
|
||||
double minDihedralDeg, double maxDihedralDeg,
|
||||
double forceConst);
|
||||
|
||||
~TorsionConstraintContrib() {}
|
||||
double getEnergy(double *pos) const;
|
||||
~TorsionConstraintContrib() override {}
|
||||
double getEnergy(double *pos) const override;
|
||||
|
||||
void getGrad(double *pos, double *grad) const;
|
||||
virtual TorsionConstraintContrib *copy() const {
|
||||
void getGrad(double *pos, double *grad) const override;
|
||||
TorsionConstraintContrib *copy() const override {
|
||||
return new TorsionConstraintContrib(*this);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,10 +47,12 @@ class RDKIT_FORCEFIELD_EXPORT AngleBendContrib : public ForceFieldContrib {
|
||||
unsigned int idx3, double bondOrder12, double bondOrder23,
|
||||
const AtomicParams *at1Params, const AtomicParams *at2Params,
|
||||
const AtomicParams *at3Params, unsigned int order = 0);
|
||||
double getEnergy(double *pos) const;
|
||||
void getGrad(double *pos, double *grad) const;
|
||||
double getEnergy(double *pos) const override;
|
||||
void getGrad(double *pos, double *grad) const override;
|
||||
|
||||
virtual AngleBendContrib *copy() const { return new AngleBendContrib(*this); }
|
||||
AngleBendContrib *copy() const override {
|
||||
return new AngleBendContrib(*this);
|
||||
}
|
||||
|
||||
private:
|
||||
int d_at1Idx{-1};
|
||||
|
||||
@@ -43,12 +43,12 @@ class RDKIT_FORCEFIELD_EXPORT AngleConstraintContrib
|
||||
double minAngleDeg, double maxAngleDeg,
|
||||
double forceConst);
|
||||
|
||||
~AngleConstraintContrib() {}
|
||||
double getEnergy(double *pos) const;
|
||||
~AngleConstraintContrib() override {}
|
||||
double getEnergy(double *pos) const override;
|
||||
|
||||
void getGrad(double *pos, double *grad) const;
|
||||
void getGrad(double *pos, double *grad) const override;
|
||||
|
||||
virtual AngleConstraintContrib *copy() const {
|
||||
AngleConstraintContrib *copy() const override {
|
||||
return new AngleConstraintContrib(*this);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,11 +34,11 @@ class RDKIT_FORCEFIELD_EXPORT BondStretchContrib : public ForceFieldContrib {
|
||||
double bondOrder, const AtomicParams *end1Params,
|
||||
const AtomicParams *end2Params);
|
||||
|
||||
double getEnergy(double *pos) const;
|
||||
double getEnergy(double *pos) const override;
|
||||
|
||||
void getGrad(double *pos, double *grad) const;
|
||||
void getGrad(double *pos, double *grad) const override;
|
||||
|
||||
virtual BondStretchContrib *copy() const {
|
||||
BondStretchContrib *copy() const override {
|
||||
return new BondStretchContrib(*this);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,14 +40,14 @@ class RDKIT_FORCEFIELD_EXPORT DistanceConstraintContrib
|
||||
unsigned int idx2, bool relative, double minLen,
|
||||
double maxLen, double forceConst);
|
||||
|
||||
~DistanceConstraintContrib() {
|
||||
~DistanceConstraintContrib() override {
|
||||
// std::cerr << " ==== Destroy constraint " << d_end1Idx << " " << d_end2Idx
|
||||
// << std::endl;
|
||||
}
|
||||
double getEnergy(double *pos) const;
|
||||
double getEnergy(double *pos) const override;
|
||||
|
||||
void getGrad(double *pos, double *grad) const;
|
||||
virtual DistanceConstraintContrib *copy() const {
|
||||
void getGrad(double *pos, double *grad) const override;
|
||||
DistanceConstraintContrib *copy() const override {
|
||||
return new DistanceConstraintContrib(*this);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,10 +40,12 @@ class RDKIT_FORCEFIELD_EXPORT InversionContrib : public ForceFieldContrib {
|
||||
unsigned int idx3, unsigned int idx4, int at2AtomicNum,
|
||||
bool isCBoundToO, double oobForceScalingFactor = 1.0);
|
||||
|
||||
double getEnergy(double *pos) const;
|
||||
double getEnergy(double *pos) const override;
|
||||
|
||||
void getGrad(double *pos, double *grad) const;
|
||||
virtual InversionContrib *copy() const { return new InversionContrib(*this); }
|
||||
void getGrad(double *pos, double *grad) const override;
|
||||
InversionContrib *copy() const override {
|
||||
return new InversionContrib(*this);
|
||||
}
|
||||
|
||||
private:
|
||||
int d_at1Idx{-1};
|
||||
|
||||
@@ -46,9 +46,9 @@ class RDKIT_FORCEFIELD_EXPORT vdWContrib : public ForceFieldContrib {
|
||||
vdWContrib(ForceField *owner, unsigned int idx1, unsigned int idx2,
|
||||
const AtomicParams *at1Params, const AtomicParams *at2Params,
|
||||
double threshMultiplier = 10.0);
|
||||
double getEnergy(double *pos) const;
|
||||
void getGrad(double *pos, double *grad) const;
|
||||
virtual vdWContrib *copy() const { return new vdWContrib(*this); }
|
||||
double getEnergy(double *pos) const override;
|
||||
void getGrad(double *pos, double *grad) const override;
|
||||
vdWContrib *copy() const override { return new vdWContrib(*this); }
|
||||
|
||||
private:
|
||||
int d_at1Idx{-1};
|
||||
|
||||
@@ -36,11 +36,11 @@ class RDKIT_FORCEFIELD_EXPORT PositionConstraintContrib
|
||||
PositionConstraintContrib(ForceField *owner, unsigned int idx,
|
||||
double maxDispl, double forceConst);
|
||||
|
||||
~PositionConstraintContrib() {}
|
||||
double getEnergy(double *pos) const;
|
||||
~PositionConstraintContrib() override {}
|
||||
double getEnergy(double *pos) const override;
|
||||
|
||||
void getGrad(double *pos, double *grad) const;
|
||||
virtual PositionConstraintContrib *copy() const {
|
||||
void getGrad(double *pos, double *grad) const override;
|
||||
PositionConstraintContrib *copy() const override {
|
||||
return new PositionConstraintContrib(*this);
|
||||
}
|
||||
|
||||
|
||||
@@ -64,12 +64,12 @@ class RDKIT_FORCEFIELD_EXPORT TorsionAngleContrib : public ForceFieldContrib {
|
||||
RDKit::Atom::HybridizationType hyb3,
|
||||
const AtomicParams *at2Params,
|
||||
const AtomicParams *at3Params, bool endAtomIsSP2 = false);
|
||||
double getEnergy(double *pos) const;
|
||||
void getGrad(double *pos, double *grad) const;
|
||||
double getEnergy(double *pos) const override;
|
||||
void getGrad(double *pos, double *grad) const override;
|
||||
void scaleForceConstant(unsigned int count) {
|
||||
this->d_forceConstant /= static_cast<double>(count);
|
||||
}
|
||||
virtual TorsionAngleContrib *copy() const {
|
||||
TorsionAngleContrib *copy() const override {
|
||||
return new TorsionAngleContrib(*this);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,11 +45,11 @@ class RDKIT_FORCEFIELD_EXPORT TorsionConstraintContrib
|
||||
double minDihedralDeg, double maxDihedralDeg,
|
||||
double forceConst);
|
||||
|
||||
~TorsionConstraintContrib() {}
|
||||
double getEnergy(double *pos) const;
|
||||
~TorsionConstraintContrib() override {}
|
||||
double getEnergy(double *pos) const override;
|
||||
|
||||
void getGrad(double *pos, double *grad) const;
|
||||
virtual TorsionConstraintContrib *copy() const {
|
||||
void getGrad(double *pos, double *grad) const override;
|
||||
TorsionConstraintContrib *copy() const override {
|
||||
return new TorsionConstraintContrib(*this);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ class RDKIT_RDGEOMETRYLIB_EXPORT GridException : public std::exception {
|
||||
GridException(std::string msg) : _msg(std::move(msg)) {}
|
||||
//! get the error message
|
||||
const char *what() const noexcept override { return _msg.c_str(); }
|
||||
~GridException() noexcept {}
|
||||
~GridException() noexcept override {}
|
||||
|
||||
private:
|
||||
std::string _msg;
|
||||
|
||||
@@ -54,36 +54,36 @@ class RDKIT_RDGEOMETRYLIB_EXPORT UniformGrid3D : public Grid3D {
|
||||
UniformGrid3D(const char *pkl, unsigned int);
|
||||
UniformGrid3D &operator=(const UniformGrid3D &other);
|
||||
|
||||
~UniformGrid3D();
|
||||
~UniformGrid3D() override;
|
||||
|
||||
//! \brief Get the index of the grid point closest to point
|
||||
//!
|
||||
//! \return the integer index, -1 if the specified point is outside the grid
|
||||
int getGridPointIndex(const Point3D &point) const;
|
||||
int getGridPointIndex(const Point3D &point) const override;
|
||||
|
||||
//! \brief Get the value at the grid point closest to the specified point
|
||||
//!
|
||||
//! \return the integer value, -1 if the specified index is outside the grid
|
||||
int getVal(const Point3D &point) const;
|
||||
int getVal(const Point3D &point) const override;
|
||||
|
||||
//! \brief Get the value at a specified grid point
|
||||
//!
|
||||
//! \return the unsigned integer value
|
||||
unsigned int getVal(unsigned int pointId) const;
|
||||
unsigned int getVal(unsigned int pointId) const override;
|
||||
|
||||
//! \brief Set the value at the grid point closest to the specified point
|
||||
//!
|
||||
//! doesn't do anything if the point is outside the grid
|
||||
void setVal(const Point3D &point, unsigned int val);
|
||||
void setVal(const Point3D &point, unsigned int val) override;
|
||||
|
||||
//! \brief get the location of the specified grid point
|
||||
Point3D getGridPointLoc(unsigned int pointId) const;
|
||||
Point3D getGridPointLoc(unsigned int pointId) const override;
|
||||
|
||||
//! \brief Set the value at the specified grid point
|
||||
void setVal(unsigned int pointId, unsigned int val);
|
||||
void setVal(unsigned int pointId, unsigned int val) override;
|
||||
|
||||
//! \brief get the size of the grid (number of grid points)
|
||||
unsigned int getSize() const { return d_numX * d_numY * d_numZ; }
|
||||
unsigned int getSize() const override { return d_numX * d_numY * d_numZ; }
|
||||
|
||||
//! \brief set the occupancy for a multi-layered sphere
|
||||
/*!
|
||||
@@ -130,7 +130,7 @@ class RDKIT_RDGEOMETRYLIB_EXPORT UniformGrid3D : public Grid3D {
|
||||
double getSpacing() const { return d_spacing; }
|
||||
|
||||
//! \brief return a \b const pointer to our occupancy vector
|
||||
const RDKit::DiscreteValueVect *getOccupancyVect() const {
|
||||
const RDKit::DiscreteValueVect *getOccupancyVect() const override {
|
||||
return dp_storage;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,16 +60,16 @@ class RDKIT_RDGEOMETRYLIB_EXPORT Point3D : public Point {
|
||||
Point3D() {}
|
||||
Point3D(double xv, double yv, double zv) : x(xv), y(yv), z(zv) {}
|
||||
|
||||
~Point3D() {}
|
||||
~Point3D() override {}
|
||||
|
||||
Point3D(const Point3D &other)
|
||||
: Point(other), x(other.x), y(other.y), z(other.z) {}
|
||||
|
||||
virtual Point *copy() const { return new Point3D(*this); }
|
||||
Point *copy() const override { return new Point3D(*this); }
|
||||
|
||||
inline unsigned int dimension() const { return 3; }
|
||||
inline unsigned int dimension() const override { return 3; }
|
||||
|
||||
inline double operator[](unsigned int i) const {
|
||||
inline double operator[](unsigned int i) const override {
|
||||
PRECONDITION(i < 3, "Invalid index on Point3D");
|
||||
if (i == 0) {
|
||||
return x;
|
||||
@@ -80,7 +80,7 @@ class RDKIT_RDGEOMETRYLIB_EXPORT Point3D : public Point {
|
||||
}
|
||||
}
|
||||
|
||||
inline double &operator[](unsigned int i) {
|
||||
inline double &operator[](unsigned int i) override {
|
||||
PRECONDITION(i < 3, "Invalid index on Point3D");
|
||||
if (i == 0) {
|
||||
return x;
|
||||
@@ -137,19 +137,19 @@ class RDKIT_RDGEOMETRYLIB_EXPORT Point3D : public Point {
|
||||
return res;
|
||||
}
|
||||
|
||||
void normalize() {
|
||||
void normalize() override {
|
||||
double l = this->length();
|
||||
x /= l;
|
||||
y /= l;
|
||||
z /= l;
|
||||
}
|
||||
|
||||
double length() const {
|
||||
double length() const override {
|
||||
double res = x * x + y * y + z * z;
|
||||
return sqrt(res);
|
||||
}
|
||||
|
||||
double lengthSq() const {
|
||||
double lengthSq() const override {
|
||||
// double res = pow(x,2) + pow(y,2) + pow(z,2);
|
||||
double res = x * x + y * y + z * z;
|
||||
return res;
|
||||
@@ -276,17 +276,17 @@ class RDKIT_RDGEOMETRYLIB_EXPORT Point2D : public Point {
|
||||
|
||||
Point2D() {}
|
||||
Point2D(double xv, double yv) : x(xv), y(yv) {}
|
||||
~Point2D() {}
|
||||
~Point2D() override {}
|
||||
|
||||
Point2D(const Point2D &other) : Point(other), x(other.x), y(other.y) {}
|
||||
//! construct from a Point3D (ignoring the z coordinate)
|
||||
Point2D(const Point3D &p3d) : Point(p3d), x(p3d.x), y(p3d.y) {}
|
||||
|
||||
virtual Point *copy() const { return new Point2D(*this); }
|
||||
Point *copy() const override { return new Point2D(*this); }
|
||||
|
||||
inline unsigned int dimension() const { return 2; }
|
||||
inline unsigned int dimension() const override { return 2; }
|
||||
|
||||
inline double operator[](unsigned int i) const {
|
||||
inline double operator[](unsigned int i) const override {
|
||||
PRECONDITION(i < 2, "Invalid index on Point2D");
|
||||
if (i == 0) {
|
||||
return x;
|
||||
@@ -295,7 +295,7 @@ class RDKIT_RDGEOMETRYLIB_EXPORT Point2D : public Point {
|
||||
}
|
||||
}
|
||||
|
||||
inline double &operator[](unsigned int i) {
|
||||
inline double &operator[](unsigned int i) override {
|
||||
PRECONDITION(i < 2, "Invalid index on Point2D");
|
||||
if (i == 0) {
|
||||
return x;
|
||||
@@ -341,7 +341,7 @@ class RDKIT_RDGEOMETRYLIB_EXPORT Point2D : public Point {
|
||||
return res;
|
||||
}
|
||||
|
||||
void normalize() {
|
||||
void normalize() override {
|
||||
double ln = this->length();
|
||||
x /= ln;
|
||||
y /= ln;
|
||||
@@ -353,13 +353,13 @@ class RDKIT_RDGEOMETRYLIB_EXPORT Point2D : public Point {
|
||||
y = temp;
|
||||
}
|
||||
|
||||
double length() const {
|
||||
double length() const override {
|
||||
// double res = pow(x,2) + pow(y,2);
|
||||
double res = x * x + y * y;
|
||||
return sqrt(res);
|
||||
}
|
||||
|
||||
double lengthSq() const {
|
||||
double lengthSq() const override {
|
||||
double res = x * x + y * y;
|
||||
return res;
|
||||
}
|
||||
@@ -414,7 +414,7 @@ class RDKIT_RDGEOMETRYLIB_EXPORT PointND : public Point {
|
||||
dp_storage.reset(nvec);
|
||||
}
|
||||
|
||||
virtual Point *copy() const { return new PointND(*this); }
|
||||
Point *copy() const override { return new PointND(*this); }
|
||||
|
||||
#if 0
|
||||
template <typename T>
|
||||
@@ -432,21 +432,25 @@ class RDKIT_RDGEOMETRYLIB_EXPORT PointND : public Point {
|
||||
};
|
||||
#endif
|
||||
|
||||
~PointND() {}
|
||||
~PointND() override {}
|
||||
|
||||
inline double operator[](unsigned int i) const {
|
||||
inline double operator[](unsigned int i) const override {
|
||||
return dp_storage.get()->getVal(i);
|
||||
}
|
||||
|
||||
inline double &operator[](unsigned int i) { return (*dp_storage.get())[i]; }
|
||||
inline double &operator[](unsigned int i) override {
|
||||
return (*dp_storage.get())[i];
|
||||
}
|
||||
|
||||
inline void normalize() { dp_storage.get()->normalize(); }
|
||||
inline void normalize() override { dp_storage.get()->normalize(); }
|
||||
|
||||
inline double length() const { return dp_storage.get()->normL2(); }
|
||||
inline double length() const override { return dp_storage.get()->normL2(); }
|
||||
|
||||
inline double lengthSq() const { return dp_storage.get()->normL2Sq(); }
|
||||
inline double lengthSq() const override {
|
||||
return dp_storage.get()->normL2Sq();
|
||||
}
|
||||
|
||||
unsigned int dimension() const { return dp_storage.get()->size(); }
|
||||
unsigned int dimension() const override { return dp_storage.get()->size(); }
|
||||
|
||||
PointND &operator=(const PointND &other) {
|
||||
if (this == &other) return *this;
|
||||
|
||||
@@ -76,15 +76,15 @@ class RDKIT_CHEMREACTIONS_EXPORT CartesianProductStrategy
|
||||
|
||||
using EnumerationStrategyBase::initialize;
|
||||
|
||||
virtual void initializeStrategy(const ChemicalReaction &,
|
||||
const EnumerationTypes::BBS &) {
|
||||
void initializeStrategy(const ChemicalReaction &,
|
||||
const EnumerationTypes::BBS &) override {
|
||||
m_numPermutationsProcessed = 0;
|
||||
}
|
||||
|
||||
virtual const char *type() const { return "CartesianProductStrategy"; }
|
||||
const char *type() const override { return "CartesianProductStrategy"; }
|
||||
|
||||
//! The current permutation {r1, r2, ...}
|
||||
virtual const EnumerationTypes::RGROUPS &next() {
|
||||
const EnumerationTypes::RGROUPS &next() override {
|
||||
if (m_numPermutationsProcessed) {
|
||||
increment();
|
||||
} else
|
||||
@@ -93,13 +93,13 @@ class RDKIT_CHEMREACTIONS_EXPORT CartesianProductStrategy
|
||||
return m_permutation;
|
||||
}
|
||||
|
||||
virtual boost::uint64_t getPermutationIdx() const {
|
||||
boost::uint64_t getPermutationIdx() const override {
|
||||
return m_numPermutationsProcessed;
|
||||
}
|
||||
|
||||
virtual operator bool() const { return hasNext(); }
|
||||
operator bool() const override { return hasNext(); }
|
||||
|
||||
EnumerationStrategyBase *copy() const {
|
||||
EnumerationStrategyBase *copy() const override {
|
||||
return new CartesianProductStrategy(*this);
|
||||
}
|
||||
|
||||
|
||||
@@ -131,10 +131,10 @@ class RDKIT_CHEMREACTIONS_EXPORT EnumerateLibrary
|
||||
const EnumerationTypes::BBS &getReagents() const { return m_bbs; }
|
||||
|
||||
//! Get the next product set
|
||||
std::vector<MOL_SPTR_VECT> next();
|
||||
std::vector<MOL_SPTR_VECT> next() override;
|
||||
|
||||
void toStream(std::ostream &ss) const;
|
||||
void initFromStream(std::istream &ss);
|
||||
void toStream(std::ostream &ss) const override;
|
||||
void initFromStream(std::istream &ss) override;
|
||||
|
||||
private:
|
||||
#ifdef RDK_USE_BOOST_SERIALIZATION
|
||||
|
||||
@@ -60,7 +60,7 @@ class RDKIT_CHEMREACTIONS_EXPORT EnumerationStrategyException
|
||||
EnumerationStrategyException(const char *msg) : _msg(msg) {}
|
||||
EnumerationStrategyException(std::string msg) : _msg(std::move(msg)) {}
|
||||
const char *what() const noexcept override { return _msg.c_str(); }
|
||||
~EnumerationStrategyException() noexcept {}
|
||||
~EnumerationStrategyException() noexcept override {}
|
||||
|
||||
private:
|
||||
std::string _msg;
|
||||
|
||||
@@ -97,7 +97,7 @@ class RDKIT_CHEMREACTIONS_EXPORT EvenSamplePairsStrategy
|
||||
rejected_slack_condition(rhs.rejected_slack_condition),
|
||||
rejected_bb_sampling_condition(rhs.rejected_bb_sampling_condition) {}
|
||||
|
||||
virtual const char *type() const { return "EvenSamplePairsStrategy"; }
|
||||
const char *type() const override { return "EvenSamplePairsStrategy"; }
|
||||
|
||||
//! This is a class for enumerating RGroups using Cartesian Products of
|
||||
//! reagents.
|
||||
@@ -120,19 +120,19 @@ class RDKIT_CHEMREACTIONS_EXPORT EvenSamplePairsStrategy
|
||||
*/
|
||||
using EnumerationStrategyBase::initialize;
|
||||
|
||||
virtual void initializeStrategy(const ChemicalReaction &,
|
||||
const EnumerationTypes::BBS &);
|
||||
void initializeStrategy(const ChemicalReaction &,
|
||||
const EnumerationTypes::BBS &) override;
|
||||
|
||||
//! The current permutation {r1, r2, ...}
|
||||
virtual const EnumerationTypes::RGROUPS &next();
|
||||
const EnumerationTypes::RGROUPS &next() override;
|
||||
|
||||
virtual boost::uint64_t getPermutationIdx() const {
|
||||
boost::uint64_t getPermutationIdx() const override {
|
||||
return m_numPermutationsProcessed;
|
||||
}
|
||||
|
||||
virtual operator bool() const { return true; }
|
||||
operator bool() const override { return true; }
|
||||
|
||||
EnumerationStrategyBase *copy() const {
|
||||
EnumerationStrategyBase *copy() const override {
|
||||
return new EvenSamplePairsStrategy(*this);
|
||||
}
|
||||
|
||||
|
||||
@@ -81,8 +81,8 @@ class RDKIT_CHEMREACTIONS_EXPORT RandomSampleStrategy
|
||||
|
||||
using EnumerationStrategyBase::initialize;
|
||||
|
||||
virtual void initializeStrategy(const ChemicalReaction &,
|
||||
const EnumerationTypes::BBS &) {
|
||||
void initializeStrategy(const ChemicalReaction &,
|
||||
const EnumerationTypes::BBS &) override {
|
||||
m_distributions.clear();
|
||||
for (size_t i = 0; i < m_permutationSizes.size(); ++i) {
|
||||
m_distributions.emplace_back(0, m_permutationSizes[i] - 1);
|
||||
@@ -91,10 +91,10 @@ class RDKIT_CHEMREACTIONS_EXPORT RandomSampleStrategy
|
||||
m_numPermutationsProcessed = 0;
|
||||
}
|
||||
|
||||
virtual const char *type() const { return "RandomSampleStrategy"; }
|
||||
const char *type() const override { return "RandomSampleStrategy"; }
|
||||
|
||||
//! The current permutation {r1, r2, ...}
|
||||
virtual const EnumerationTypes::RGROUPS &next() {
|
||||
const EnumerationTypes::RGROUPS &next() override {
|
||||
for (size_t i = 0; i < m_permutation.size(); ++i) {
|
||||
m_permutation[i] = m_distributions[i](m_rng);
|
||||
}
|
||||
@@ -104,13 +104,13 @@ class RDKIT_CHEMREACTIONS_EXPORT RandomSampleStrategy
|
||||
return m_permutation;
|
||||
}
|
||||
|
||||
virtual boost::uint64_t getPermutationIdx() const {
|
||||
boost::uint64_t getPermutationIdx() const override {
|
||||
return m_numPermutationsProcessed;
|
||||
}
|
||||
|
||||
virtual operator bool() const { return true; }
|
||||
operator bool() const override { return true; }
|
||||
|
||||
EnumerationStrategyBase *copy() const {
|
||||
EnumerationStrategyBase *copy() const override {
|
||||
return new RandomSampleStrategy(*this);
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ class RDKIT_CHEMREACTIONS_EXPORT RandomSampleAllBBsStrategy
|
||||
using EnumerationStrategyBase::initialize;
|
||||
|
||||
void initializeStrategy(const ChemicalReaction &,
|
||||
const EnumerationTypes::BBS &) {
|
||||
const EnumerationTypes::BBS &) override {
|
||||
m_distributions.clear();
|
||||
m_permutation.resize(m_permutationSizes.size());
|
||||
m_offset = 0;
|
||||
@@ -100,10 +100,10 @@ class RDKIT_CHEMREACTIONS_EXPORT RandomSampleAllBBsStrategy
|
||||
m_numPermutationsProcessed = 0;
|
||||
}
|
||||
|
||||
virtual const char *type() const { return "RandomSampleAllBBsStrategy"; }
|
||||
const char *type() const override { return "RandomSampleAllBBsStrategy"; }
|
||||
|
||||
//! The current permutation {r1, r2, ...}
|
||||
virtual const EnumerationTypes::RGROUPS &next() {
|
||||
const EnumerationTypes::RGROUPS &next() override {
|
||||
if (m_offset >= m_maxoffset) {
|
||||
for (size_t i = 0; i < m_permutation.size(); ++i) {
|
||||
m_permutation[i] = m_distributions[i](m_rng);
|
||||
@@ -120,13 +120,13 @@ class RDKIT_CHEMREACTIONS_EXPORT RandomSampleAllBBsStrategy
|
||||
return m_permutation;
|
||||
}
|
||||
|
||||
virtual boost::uint64_t getPermutationIdx() const {
|
||||
boost::uint64_t getPermutationIdx() const override {
|
||||
return m_numPermutationsProcessed;
|
||||
}
|
||||
|
||||
virtual operator bool() const { return true; }
|
||||
operator bool() const override { return true; }
|
||||
|
||||
EnumerationStrategyBase *copy() const {
|
||||
EnumerationStrategyBase *copy() const override {
|
||||
return new RandomSampleAllBBsStrategy(*this);
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ class RDKIT_CHEMREACTIONS_EXPORT ChemicalReactionException
|
||||
explicit ChemicalReactionException(const std::string msg) : _msg(msg) {}
|
||||
//! get the error message
|
||||
const char *what() const noexcept override { return _msg.c_str(); }
|
||||
~ChemicalReactionException() noexcept {}
|
||||
~ChemicalReactionException() noexcept override {}
|
||||
|
||||
private:
|
||||
std::string _msg;
|
||||
|
||||
@@ -57,7 +57,7 @@ class RDKIT_CHEMREACTIONS_EXPORT ChemicalReactionParserException
|
||||
: _msg(std::move(msg)) {}
|
||||
//! get the error message
|
||||
const char *what() const noexcept override { return _msg.c_str(); }
|
||||
~ChemicalReactionParserException() noexcept {}
|
||||
~ChemicalReactionParserException() noexcept override {}
|
||||
|
||||
private:
|
||||
std::string _msg;
|
||||
|
||||
@@ -31,7 +31,7 @@ class RDKIT_CHEMREACTIONS_EXPORT ReactionPicklerException
|
||||
ReactionPicklerException(const char *msg) : _msg(msg) {}
|
||||
ReactionPicklerException(const std::string msg) : _msg(msg) {}
|
||||
const char *what() const noexcept override { return _msg.c_str(); }
|
||||
~ReactionPicklerException() noexcept {}
|
||||
~ReactionPicklerException() noexcept override {}
|
||||
|
||||
private:
|
||||
std::string _msg;
|
||||
|
||||
@@ -47,7 +47,7 @@ class RDKIT_CHEMREACTIONS_EXPORT RxnSanitizeException : public std::exception {
|
||||
RxnSanitizeException(const char *msg) : _msg(msg) {}
|
||||
RxnSanitizeException(std::string msg) : _msg(std::move(msg)) {}
|
||||
const char *what() const noexcept override { return _msg.c_str(); }
|
||||
~RxnSanitizeException() noexcept {}
|
||||
~RxnSanitizeException() noexcept override {}
|
||||
|
||||
private:
|
||||
std::string _msg;
|
||||
|
||||
@@ -105,7 +105,7 @@ python::object EnumerateLibraryBase_Serialize(const EnumerateLibraryBase &en) {
|
||||
|
||||
class EnumerateLibraryWrap : public RDKit::EnumerateLibrary {
|
||||
public:
|
||||
virtual ~EnumerateLibraryWrap() {}
|
||||
~EnumerateLibraryWrap() override {}
|
||||
EnumerateLibraryWrap() : RDKit::EnumerateLibrary() {}
|
||||
EnumerateLibraryWrap(const RDKit::ChemicalReaction &rxn, python::list ob,
|
||||
const EnumerationParams & params = EnumerationParams()
|
||||
|
||||
@@ -30,7 +30,7 @@ class RDKIT_GRAPHMOL_EXPORT ConformerException : public std::exception {
|
||||
ConformerException(std::string msg) : _msg(std::move(msg)) {}
|
||||
//! get the error message
|
||||
const char *what() const noexcept override { return _msg.c_str(); }
|
||||
~ConformerException() noexcept {}
|
||||
~ConformerException() noexcept override {}
|
||||
|
||||
private:
|
||||
std::string _msg;
|
||||
|
||||
@@ -33,7 +33,7 @@ class RDKIT_DEPICTOR_EXPORT DepictException : public std::exception {
|
||||
DepictException(const char *msg) : _msg(msg) {}
|
||||
DepictException(const std::string msg) : _msg(msg) {}
|
||||
const char *what() const noexcept override { return _msg.c_str(); }
|
||||
~DepictException() noexcept {}
|
||||
~DepictException() noexcept override {}
|
||||
|
||||
private:
|
||||
std::string _msg;
|
||||
|
||||
@@ -130,12 +130,12 @@ class RDKIT_FILEPARSERS_EXPORT ForwardSDMolSupplier : public MolSupplier {
|
||||
bool removeHs = true,
|
||||
bool strictParsing = false);
|
||||
|
||||
virtual ~ForwardSDMolSupplier() { close(); }
|
||||
~ForwardSDMolSupplier() override { close(); }
|
||||
|
||||
virtual void init();
|
||||
virtual void reset();
|
||||
virtual ROMol *next();
|
||||
virtual bool atEnd();
|
||||
void init() override;
|
||||
void reset() override;
|
||||
ROMol *next() override;
|
||||
bool atEnd() override;
|
||||
|
||||
void setProcessPropertyLists(bool val) { df_processPropertyLists = val; }
|
||||
bool getProcessPropertyLists() const { return df_processPropertyLists; }
|
||||
@@ -186,11 +186,11 @@ class RDKIT_FILEPARSERS_EXPORT SDMolSupplier : public ForwardSDMolSupplier {
|
||||
bool sanitize = true, bool removeHs = true,
|
||||
bool strictParsing = true);
|
||||
|
||||
virtual ~SDMolSupplier() { close(); }
|
||||
void init();
|
||||
void reset();
|
||||
ROMol *next();
|
||||
bool atEnd();
|
||||
~SDMolSupplier() override { close(); }
|
||||
void init() override;
|
||||
void reset() override;
|
||||
ROMol *next() override;
|
||||
bool atEnd() override;
|
||||
void moveTo(unsigned int idx);
|
||||
ROMol *operator[](unsigned int idx);
|
||||
/*! \brief returns the text block for a particular item
|
||||
@@ -219,7 +219,7 @@ class RDKIT_FILEPARSERS_EXPORT SDMolSupplier : public ForwardSDMolSupplier {
|
||||
void setStreamIndices(const std::vector<std::streampos> &locs);
|
||||
|
||||
private:
|
||||
void checkForEnd();
|
||||
void checkForEnd() override;
|
||||
void setDataCommon(const std::string &text, bool sanitize, bool removeHs);
|
||||
int d_len = 0; // total number of mol blocks in the file (initialized to -1)
|
||||
int d_last = 0; // the molecule we are ready to read
|
||||
@@ -270,14 +270,14 @@ class RDKIT_FILEPARSERS_EXPORT SmilesMolSupplier : public MolSupplier {
|
||||
int smilesColumn = 0, int nameColumn = 1,
|
||||
bool titleLine = true, bool sanitize = true);
|
||||
|
||||
virtual ~SmilesMolSupplier() { close(); }
|
||||
~SmilesMolSupplier() override { close(); }
|
||||
void setData(const std::string &text, const std::string &delimiter = " ",
|
||||
int smilesColumn = 0, int nameColumn = 1, bool titleLine = true,
|
||||
bool sanitize = true);
|
||||
void init();
|
||||
void reset();
|
||||
ROMol *next();
|
||||
bool atEnd();
|
||||
void init() override;
|
||||
void reset() override;
|
||||
ROMol *next() override;
|
||||
bool atEnd() override;
|
||||
void moveTo(unsigned int idx);
|
||||
ROMol *operator[](unsigned int idx);
|
||||
/*! \brief returns the text block for a particular item
|
||||
@@ -342,13 +342,13 @@ class RDKIT_FILEPARSERS_EXPORT TDTMolSupplier : public MolSupplier {
|
||||
const std::string &nameRecord = "", int confId2D = -1,
|
||||
int confId3D = 0, bool sanitize = true);
|
||||
TDTMolSupplier();
|
||||
virtual ~TDTMolSupplier() { close(); }
|
||||
~TDTMolSupplier() override { close(); }
|
||||
void setData(const std::string &text, const std::string &nameRecord = "",
|
||||
int confId2D = -1, int confId3D = 0, bool sanitize = true);
|
||||
void init();
|
||||
void reset();
|
||||
ROMol *next();
|
||||
bool atEnd();
|
||||
void init() override;
|
||||
void reset() override;
|
||||
ROMol *next() override;
|
||||
bool atEnd() override;
|
||||
void moveTo(unsigned int idx);
|
||||
ROMol *operator[](unsigned int idx);
|
||||
/*! \brief returns the text block for a particular item
|
||||
@@ -387,12 +387,12 @@ class RDKIT_FILEPARSERS_EXPORT PDBMolSupplier : public MolSupplier {
|
||||
bool removeHs = true, unsigned int flavor = 0,
|
||||
bool proximityBonding = true);
|
||||
|
||||
virtual ~PDBMolSupplier() { close(); }
|
||||
~PDBMolSupplier() override { close(); }
|
||||
|
||||
virtual void init();
|
||||
virtual void reset();
|
||||
virtual ROMol *next();
|
||||
virtual bool atEnd();
|
||||
void init() override;
|
||||
void reset() override;
|
||||
ROMol *next() override;
|
||||
bool atEnd() override;
|
||||
|
||||
protected:
|
||||
bool df_sanitize, df_removeHs, df_proximityBonding;
|
||||
@@ -419,14 +419,14 @@ class RDKIT_FILEPARSERS_EXPORT MaeMolSupplier : public MolSupplier {
|
||||
explicit MaeMolSupplier(const std::string &fname, bool sanitize = true,
|
||||
bool removeHs = true);
|
||||
|
||||
virtual ~MaeMolSupplier() {}
|
||||
~MaeMolSupplier() override {}
|
||||
|
||||
virtual void init();
|
||||
virtual void reset();
|
||||
virtual ROMol *next();
|
||||
virtual bool atEnd();
|
||||
void init() override;
|
||||
void reset() override;
|
||||
ROMol *next() override;
|
||||
bool atEnd() override;
|
||||
|
||||
virtual void close() { dp_sInStream.reset(); }
|
||||
void close() override { dp_sInStream.reset(); }
|
||||
|
||||
private:
|
||||
void moveToNextBlock();
|
||||
|
||||
@@ -65,17 +65,17 @@ class RDKIT_FILEPARSERS_EXPORT SmilesWriter : public MolWriter {
|
||||
bool takeOwnership = false, bool isomericSmiles = true,
|
||||
bool kekuleSmiles = false);
|
||||
|
||||
~SmilesWriter();
|
||||
~SmilesWriter() override;
|
||||
|
||||
//! \brief set a vector of property names that are need to be
|
||||
//! written out for each molecule
|
||||
void setProps(const STR_VECT &propNames);
|
||||
void setProps(const STR_VECT &propNames) override;
|
||||
|
||||
//! \brief write a new molecule to the file
|
||||
void write(const ROMol &mol, int confId = defaultConfId);
|
||||
void write(const ROMol &mol, int confId = defaultConfId) override;
|
||||
|
||||
//! \brief flush the ostream
|
||||
void flush() {
|
||||
void flush() override {
|
||||
PRECONDITION(dp_ostream, "no output stream");
|
||||
try {
|
||||
dp_ostream->flush();
|
||||
@@ -88,7 +88,7 @@ class RDKIT_FILEPARSERS_EXPORT SmilesWriter : public MolWriter {
|
||||
}
|
||||
|
||||
//! \brief close our stream (the writer cannot be used again)
|
||||
void close() {
|
||||
void close() override {
|
||||
if (dp_ostream) {
|
||||
flush();
|
||||
}
|
||||
@@ -100,7 +100,7 @@ class RDKIT_FILEPARSERS_EXPORT SmilesWriter : public MolWriter {
|
||||
}
|
||||
|
||||
//! \brief get the number of molecules written so far
|
||||
unsigned int numMols() const { return d_molid; }
|
||||
unsigned int numMols() const override { return d_molid; }
|
||||
|
||||
private:
|
||||
// local initialization
|
||||
@@ -138,11 +138,11 @@ class RDKIT_FILEPARSERS_EXPORT SDWriter : public MolWriter {
|
||||
SDWriter(const std::string &fileName);
|
||||
SDWriter(std::ostream *outStream, bool takeOwnership = false);
|
||||
|
||||
~SDWriter();
|
||||
~SDWriter() override;
|
||||
|
||||
//! \brief set a vector of property names that are need to be
|
||||
//! written out for each molecule
|
||||
void setProps(const STR_VECT &propNames);
|
||||
void setProps(const STR_VECT &propNames) override;
|
||||
|
||||
//! \brief return the text that would be written to the file
|
||||
static std::string getText(const ROMol &mol, int confId = defaultConfId,
|
||||
@@ -150,10 +150,10 @@ class RDKIT_FILEPARSERS_EXPORT SDWriter : public MolWriter {
|
||||
int molid = -1, STR_VECT *propNames = nullptr);
|
||||
|
||||
//! \brief write a new molecule to the file
|
||||
void write(const ROMol &mol, int confId = defaultConfId);
|
||||
void write(const ROMol &mol, int confId = defaultConfId) override;
|
||||
|
||||
//! \brief flush the ostream
|
||||
void flush() {
|
||||
void flush() override {
|
||||
PRECONDITION(dp_ostream, "no output stream");
|
||||
try {
|
||||
dp_ostream->flush();
|
||||
@@ -166,7 +166,7 @@ class RDKIT_FILEPARSERS_EXPORT SDWriter : public MolWriter {
|
||||
}
|
||||
|
||||
//! \brief close our stream (the writer cannot be used again)
|
||||
void close() {
|
||||
void close() override {
|
||||
if (dp_ostream) {
|
||||
flush();
|
||||
}
|
||||
@@ -178,7 +178,7 @@ class RDKIT_FILEPARSERS_EXPORT SDWriter : public MolWriter {
|
||||
}
|
||||
|
||||
//! \brief get the number of molecules written so far
|
||||
unsigned int numMols() const { return d_molid; }
|
||||
unsigned int numMols() const override { return d_molid; }
|
||||
|
||||
void setForceV3000(bool val) { df_forceV3000 = val; }
|
||||
bool getForceV3000() const { return df_forceV3000; }
|
||||
@@ -214,17 +214,17 @@ class RDKIT_FILEPARSERS_EXPORT TDTWriter : public MolWriter {
|
||||
TDTWriter(const std::string &fileName);
|
||||
TDTWriter(std::ostream *outStream, bool takeOwnership = false);
|
||||
|
||||
~TDTWriter();
|
||||
~TDTWriter() override;
|
||||
|
||||
//! \brief set a vector of property names that are need to be
|
||||
//! written out for each molecule
|
||||
void setProps(const STR_VECT &propNames);
|
||||
void setProps(const STR_VECT &propNames) override;
|
||||
|
||||
//! \brief write a new molecule to the file
|
||||
void write(const ROMol &mol, int confId = defaultConfId);
|
||||
void write(const ROMol &mol, int confId = defaultConfId) override;
|
||||
|
||||
//! \brief flush the ostream
|
||||
void flush() {
|
||||
void flush() override {
|
||||
PRECONDITION(dp_ostream, "no output stream");
|
||||
try {
|
||||
dp_ostream->flush();
|
||||
@@ -237,7 +237,7 @@ class RDKIT_FILEPARSERS_EXPORT TDTWriter : public MolWriter {
|
||||
}
|
||||
|
||||
//! \brief close our stream (the writer cannot be used again)
|
||||
void close() {
|
||||
void close() override {
|
||||
if (dp_ostream) {
|
||||
// if we've written any mols, finish with a "|" line
|
||||
if (d_molid > 0) {
|
||||
@@ -253,7 +253,7 @@ class RDKIT_FILEPARSERS_EXPORT TDTWriter : public MolWriter {
|
||||
}
|
||||
|
||||
//! \brief get the number of molecules written so far
|
||||
unsigned int numMols() const { return d_molid; }
|
||||
unsigned int numMols() const override { return d_molid; }
|
||||
|
||||
void setWrite2D(bool state = true) { df_write2D = state; }
|
||||
bool getWrite2D() const { return df_write2D; }
|
||||
@@ -284,15 +284,15 @@ class RDKIT_FILEPARSERS_EXPORT PDBWriter : public MolWriter {
|
||||
PDBWriter(const std::string &fileName, unsigned int flavor = 0);
|
||||
PDBWriter(std::ostream *outStream, bool takeOwnership = false,
|
||||
unsigned int flavor = 0);
|
||||
~PDBWriter();
|
||||
~PDBWriter() override;
|
||||
|
||||
//! \brief write a new molecule to the file
|
||||
void write(const ROMol &mol, int confId = defaultConfId);
|
||||
void write(const ROMol &mol, int confId = defaultConfId) override;
|
||||
|
||||
void setProps(const STR_VECT &) {}
|
||||
void setProps(const STR_VECT &) override {}
|
||||
|
||||
//! \brief flush the ostream
|
||||
void flush() {
|
||||
void flush() override {
|
||||
PRECONDITION(dp_ostream, "no output stream");
|
||||
try {
|
||||
dp_ostream->flush();
|
||||
@@ -305,7 +305,7 @@ class RDKIT_FILEPARSERS_EXPORT PDBWriter : public MolWriter {
|
||||
}
|
||||
|
||||
//! \brief close our stream (the writer cannot be used again)
|
||||
void close() {
|
||||
void close() override {
|
||||
if (dp_ostream) {
|
||||
flush();
|
||||
}
|
||||
@@ -317,7 +317,7 @@ class RDKIT_FILEPARSERS_EXPORT PDBWriter : public MolWriter {
|
||||
}
|
||||
|
||||
//! \brief get the number of molecules written so far
|
||||
unsigned int numMols() const { return d_count; }
|
||||
unsigned int numMols() const override { return d_count; }
|
||||
|
||||
private:
|
||||
std::ostream *dp_ostream;
|
||||
|
||||
@@ -33,11 +33,11 @@ class RDKIT_FILEPARSERS_EXPORT MultithreadedMolSupplier : public MolSupplier {
|
||||
//! time
|
||||
public:
|
||||
MultithreadedMolSupplier() {}
|
||||
virtual ~MultithreadedMolSupplier();
|
||||
~MultithreadedMolSupplier() override;
|
||||
//! pop elements from the output queue
|
||||
ROMol *next();
|
||||
ROMol *next() override;
|
||||
//! returns true when all records have been read from the supplier
|
||||
bool atEnd();
|
||||
bool atEnd() override;
|
||||
|
||||
//! included for the interface, always returns false
|
||||
bool getEOFHitOnRead() const { return false; }
|
||||
@@ -69,8 +69,8 @@ class RDKIT_FILEPARSERS_EXPORT MultithreadedMolSupplier : public MolSupplier {
|
||||
MultithreadedMolSupplier(const MultithreadedMolSupplier &);
|
||||
MultithreadedMolSupplier &operator=(const MultithreadedMolSupplier &);
|
||||
//! not yet implemented
|
||||
virtual void reset();
|
||||
virtual void init() = 0;
|
||||
void reset() override;
|
||||
void init() override = 0;
|
||||
virtual bool getEnd() const = 0;
|
||||
//! extracts next record from the input file or stream
|
||||
virtual bool extractNextRecord(std::string &record, unsigned int &lineNum,
|
||||
|
||||
@@ -30,21 +30,22 @@ class RDKIT_FILEPARSERS_EXPORT MultithreadedSDMolSupplier
|
||||
size_t sizeOutputQueue = 5);
|
||||
|
||||
MultithreadedSDMolSupplier();
|
||||
~MultithreadedSDMolSupplier();
|
||||
void init() {}
|
||||
~MultithreadedSDMolSupplier() override;
|
||||
void init() override {}
|
||||
|
||||
void checkForEnd();
|
||||
bool getEnd() const;
|
||||
bool getEnd() const override;
|
||||
void setProcessPropertyLists(bool val) { df_processPropertyLists = val; }
|
||||
bool getProcessPropertyLists() const { return df_processPropertyLists; }
|
||||
bool getEOFHitOnRead() const { return df_eofHitOnRead; }
|
||||
|
||||
//! reads next record and returns whether or not EOF was hit
|
||||
bool extractNextRecord(std::string &record, unsigned int &lineNum,
|
||||
unsigned int &index);
|
||||
unsigned int &index) override;
|
||||
void readMolProps(ROMol *mol, std::istringstream &inStream);
|
||||
//! parses the record and returns the resulting molecule
|
||||
ROMol *processMoleculeRecord(const std::string &record, unsigned int lineNum);
|
||||
ROMol *processMoleculeRecord(const std::string &record,
|
||||
unsigned int lineNum) override;
|
||||
|
||||
private:
|
||||
void initFromSettings(bool takeOwnership, bool sanitize, bool removeHs,
|
||||
|
||||
@@ -30,18 +30,19 @@ class RDKIT_FILEPARSERS_EXPORT MultithreadedSmilesMolSupplier
|
||||
unsigned int numWriterThreads = 1, size_t sizeInputQueue = 5,
|
||||
size_t sizeOutputQueue = 5);
|
||||
MultithreadedSmilesMolSupplier();
|
||||
~MultithreadedSmilesMolSupplier();
|
||||
~MultithreadedSmilesMolSupplier() override;
|
||||
|
||||
void init() {}
|
||||
void init() override {}
|
||||
//! returns df_end
|
||||
bool getEnd() const;
|
||||
bool getEnd() const override;
|
||||
//! reads and processes the title line
|
||||
void processTitleLine();
|
||||
//! reads next record and returns whether or not EOF was hit
|
||||
bool extractNextRecord(std::string &record, unsigned int &lineNum,
|
||||
unsigned int &index);
|
||||
unsigned int &index) override;
|
||||
//! parses the record and returns the resulting molecule
|
||||
ROMol *processMoleculeRecord(const std::string &record, unsigned int lineNum);
|
||||
ROMol *processMoleculeRecord(const std::string &record,
|
||||
unsigned int lineNum) override;
|
||||
|
||||
private:
|
||||
void initFromSettings(bool takeOwnership, const std::string &delimiter,
|
||||
|
||||
@@ -31,7 +31,7 @@ using namespace std::chrono;
|
||||
// Usage Example: PrintThread{} << "something";
|
||||
struct PrintThread : public std::stringstream {
|
||||
static std::mutex cout_mutex;
|
||||
~PrintThread() {
|
||||
~PrintThread() override {
|
||||
std::lock_guard<std::mutex> l{cout_mutex};
|
||||
std::cout << rdbuf();
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ class RDKIT_FILTERCATALOG_EXPORT FilterCatalogParams
|
||||
FilterCatalogParams(const FilterCatalogParams &other)
|
||||
: RDCatalog::CatalogParams(other), d_catalogs(other.d_catalogs) {}
|
||||
|
||||
virtual ~FilterCatalogParams() {}
|
||||
~FilterCatalogParams() override {}
|
||||
|
||||
//------------------------------------
|
||||
//! Adds an existing FilterCatalog specification to be used in the
|
||||
@@ -87,13 +87,13 @@ class RDKIT_FILTERCATALOG_EXPORT FilterCatalogParams
|
||||
virtual void fillCatalog(FilterCatalog &catalog) const;
|
||||
|
||||
//! serializes (pickles) to a stream
|
||||
virtual void toStream(std::ostream &ss) const;
|
||||
void toStream(std::ostream &ss) const override;
|
||||
//! returns a string with a serialized (pickled) representation
|
||||
virtual std::string Serialize() const;
|
||||
std::string Serialize() const override;
|
||||
//! initializes from a stream pickle
|
||||
virtual void initFromStream(std::istream &ss);
|
||||
void initFromStream(std::istream &ss) override;
|
||||
//! initializes from a string pickle
|
||||
virtual void initFromString(const std::string &text);
|
||||
void initFromString(const std::string &text) override;
|
||||
|
||||
private:
|
||||
std::vector<FilterCatalogs> d_catalogs;
|
||||
@@ -135,9 +135,9 @@ class RDKIT_FILTERCATALOG_EXPORT FilterCatalog : public FCatalog {
|
||||
|
||||
FilterCatalog(const std::string &binStr);
|
||||
|
||||
~FilterCatalog();
|
||||
~FilterCatalog() override;
|
||||
|
||||
virtual std::string Serialize() const;
|
||||
std::string Serialize() const override;
|
||||
|
||||
// Adds a new FilterCatalogEntry to the catalog
|
||||
/*!
|
||||
@@ -148,8 +148,8 @@ class RDKIT_FILTERCATALOG_EXPORT FilterCatalog : public FCatalog {
|
||||
\param updateFPLength unused in the FilterCatalog object.
|
||||
*/
|
||||
|
||||
virtual unsigned int addEntry(FilterCatalogEntry *entry,
|
||||
bool updateFPLength = true);
|
||||
unsigned int addEntry(FilterCatalogEntry *entry,
|
||||
bool updateFPLength = true) override;
|
||||
|
||||
// Adds a new FilterCatalogEntry to the catalog
|
||||
/*!
|
||||
@@ -177,7 +177,7 @@ class RDKIT_FILTERCATALOG_EXPORT FilterCatalog : public FCatalog {
|
||||
//------------------------------------
|
||||
//! returns a particular FilterCatalogEntry in the Catalog
|
||||
//! required by Catalog.h API
|
||||
virtual const FilterCatalogEntry *getEntryWithIdx(unsigned int idx) const;
|
||||
const FilterCatalogEntry *getEntryWithIdx(unsigned int idx) const override;
|
||||
|
||||
//------------------------------------
|
||||
//! returns a particular FilterCatalogEntry in the Catalog
|
||||
@@ -192,7 +192,7 @@ class RDKIT_FILTERCATALOG_EXPORT FilterCatalog : public FCatalog {
|
||||
|
||||
//------------------------------------
|
||||
//! returns the number of entries in the catalog
|
||||
virtual unsigned int getNumEntries() const {
|
||||
unsigned int getNumEntries() const override {
|
||||
return static_cast<unsigned int>(d_entries.size());
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ class RDKIT_FILTERCATALOG_EXPORT FilterCatalog : public FCatalog {
|
||||
\param params The new FilterCatalogParams specifying the new state of the
|
||||
catalog
|
||||
*/
|
||||
virtual void setCatalogParams(const FilterCatalogParams *params);
|
||||
void setCatalogParams(const FilterCatalogParams *params) override;
|
||||
|
||||
//------------------------------------
|
||||
//! Returns true if the molecule matches any entry in the catalog
|
||||
|
||||
@@ -78,7 +78,7 @@ class RDKIT_FILTERCATALOG_EXPORT FilterCatalogEntry
|
||||
d_matcher(rhs.d_matcher),
|
||||
d_props(rhs.d_props) {}
|
||||
|
||||
virtual ~FilterCatalogEntry() {}
|
||||
~FilterCatalogEntry() override {}
|
||||
|
||||
//------------------------------------
|
||||
//! Returns true if the Filters stored in this catalog entry are valid
|
||||
@@ -87,7 +87,7 @@ class RDKIT_FILTERCATALOG_EXPORT FilterCatalogEntry
|
||||
|
||||
//------------------------------------
|
||||
//! Returns the description of the catalog entry
|
||||
std::string getDescription() const;
|
||||
std::string getDescription() const override;
|
||||
|
||||
//------------------------------------
|
||||
//! Sets the description of the catalog entry
|
||||
@@ -214,13 +214,13 @@ class RDKIT_FILTERCATALOG_EXPORT FilterCatalogEntry
|
||||
}
|
||||
|
||||
//! serializes (pickles) to a stream
|
||||
virtual void toStream(std::ostream &ss) const;
|
||||
void toStream(std::ostream &ss) const override;
|
||||
//! returns a string with a serialized (pickled) representation
|
||||
virtual std::string Serialize() const;
|
||||
std::string Serialize() const override;
|
||||
//! initializes from a stream pickle
|
||||
virtual void initFromStream(std::istream &ss);
|
||||
void initFromStream(std::istream &ss) override;
|
||||
//! initializes from a string pickle
|
||||
virtual void initFromString(const std::string &text);
|
||||
void initFromString(const std::string &text) override;
|
||||
|
||||
private:
|
||||
#ifdef RDK_USE_BOOST_SERIALIZATION
|
||||
|
||||
@@ -72,22 +72,23 @@ class RDKIT_FILTERCATALOG_EXPORT And : public FilterMatcherBase {
|
||||
And(const And &rhs)
|
||||
: FilterMatcherBase(rhs), arg1(rhs.arg1), arg2(rhs.arg2) {}
|
||||
|
||||
virtual std::string getName() const {
|
||||
std::string getName() const override {
|
||||
return "(" + getArgName(arg1) + " " + FilterMatcherBase::getName() + " " +
|
||||
getArgName(arg2) + ")";
|
||||
}
|
||||
|
||||
bool isValid() const {
|
||||
bool isValid() const override {
|
||||
return arg1.get() && arg2.get() && arg1->isValid() && arg2->isValid();
|
||||
}
|
||||
|
||||
bool hasMatch(const ROMol &mol) const {
|
||||
bool hasMatch(const ROMol &mol) const override {
|
||||
PRECONDITION(isValid(),
|
||||
"FilterMatchOps::And is not valid, null arg1 or arg2");
|
||||
return arg1->hasMatch(mol) && arg2->hasMatch(mol);
|
||||
}
|
||||
|
||||
bool getMatches(const ROMol &mol, std::vector<FilterMatch> &matchVect) const {
|
||||
bool getMatches(const ROMol &mol,
|
||||
std::vector<FilterMatch> &matchVect) const override {
|
||||
PRECONDITION(isValid(),
|
||||
"FilterMatchOps::And is not valid, null arg1 or arg2");
|
||||
std::vector<FilterMatch> matches;
|
||||
@@ -98,7 +99,7 @@ class RDKIT_FILTERCATALOG_EXPORT And : public FilterMatcherBase {
|
||||
return false;
|
||||
}
|
||||
|
||||
boost::shared_ptr<FilterMatcherBase> copy() const {
|
||||
boost::shared_ptr<FilterMatcherBase> copy() const override {
|
||||
return boost::shared_ptr<FilterMatcherBase>(new And(*this));
|
||||
}
|
||||
|
||||
@@ -135,21 +136,22 @@ class RDKIT_FILTERCATALOG_EXPORT Or : public FilterMatcherBase {
|
||||
|
||||
Or(const Or &rhs) : FilterMatcherBase(rhs), arg1(rhs.arg1), arg2(rhs.arg2) {}
|
||||
|
||||
virtual std::string getName() const {
|
||||
std::string getName() const override {
|
||||
return "(" + getArgName(arg1) + " " + FilterMatcherBase::getName() + " " +
|
||||
getArgName(arg2) + ")";
|
||||
}
|
||||
|
||||
bool isValid() const {
|
||||
bool isValid() const override {
|
||||
return arg1.get() && arg2.get() && arg1->isValid() && arg2->isValid();
|
||||
}
|
||||
|
||||
bool hasMatch(const ROMol &mol) const {
|
||||
bool hasMatch(const ROMol &mol) const override {
|
||||
PRECONDITION(isValid(), "Or is not valid, null arg1 or arg2");
|
||||
return arg1->hasMatch(mol) || arg2->hasMatch(mol);
|
||||
}
|
||||
|
||||
bool getMatches(const ROMol &mol, std::vector<FilterMatch> &matchVect) const {
|
||||
bool getMatches(const ROMol &mol,
|
||||
std::vector<FilterMatch> &matchVect) const override {
|
||||
PRECONDITION(isValid(),
|
||||
"FilterMatchOps::Or is not valid, null arg1 or arg2");
|
||||
// we want both matches to run in order to accumulate all matches
|
||||
@@ -159,7 +161,7 @@ class RDKIT_FILTERCATALOG_EXPORT Or : public FilterMatcherBase {
|
||||
return res1 || res2;
|
||||
}
|
||||
|
||||
boost::shared_ptr<FilterMatcherBase> copy() const {
|
||||
boost::shared_ptr<FilterMatcherBase> copy() const override {
|
||||
return boost::shared_ptr<FilterMatcherBase>(new Or(*this));
|
||||
}
|
||||
|
||||
@@ -194,18 +196,18 @@ class RDKIT_FILTERCATALOG_EXPORT Not : public FilterMatcherBase {
|
||||
|
||||
Not(const Not &rhs) : FilterMatcherBase(rhs), arg1(rhs.arg1) {}
|
||||
|
||||
virtual std::string getName() const {
|
||||
std::string getName() const override {
|
||||
return "(" + FilterMatcherBase::getName() + " " + getArgName(arg1) + ")";
|
||||
}
|
||||
|
||||
bool isValid() const { return arg1.get() && arg1->isValid(); }
|
||||
bool isValid() const override { return arg1.get() && arg1->isValid(); }
|
||||
|
||||
bool hasMatch(const ROMol &mol) const {
|
||||
bool hasMatch(const ROMol &mol) const override {
|
||||
PRECONDITION(isValid(), "FilterMatchOps::Not: arg1 is null");
|
||||
return !arg1->hasMatch(mol);
|
||||
}
|
||||
|
||||
bool getMatches(const ROMol &mol, std::vector<FilterMatch> &) const {
|
||||
bool getMatches(const ROMol &mol, std::vector<FilterMatch> &) const override {
|
||||
PRECONDITION(isValid(), "FilterMatchOps::Not: arg1 is null");
|
||||
// If we are a not, we really can't hold the match for
|
||||
// this query since by definition it won't exist!
|
||||
@@ -213,7 +215,7 @@ class RDKIT_FILTERCATALOG_EXPORT Not : public FilterMatcherBase {
|
||||
return !arg1->getMatches(mol, matchVect);
|
||||
}
|
||||
|
||||
boost::shared_ptr<FilterMatcherBase> copy() const {
|
||||
boost::shared_ptr<FilterMatcherBase> copy() const override {
|
||||
return boost::shared_ptr<FilterMatcherBase>(new Not(*this));
|
||||
}
|
||||
|
||||
@@ -303,7 +305,7 @@ class RDKIT_FILTERCATALOG_EXPORT SmartsMatcher : public FilterMatcherBase {
|
||||
SmartsMatcher(const SmartsMatcher &rhs);
|
||||
|
||||
//! Returns True if the Smarts pattern is valid
|
||||
bool isValid() const { return d_pattern.get(); }
|
||||
bool isValid() const override { return d_pattern.get(); }
|
||||
|
||||
//! Return the shared_ptr to the underlying query molecule
|
||||
const ROMOL_SPTR &getPattern() const { return d_pattern; }
|
||||
@@ -323,10 +325,10 @@ class RDKIT_FILTERCATALOG_EXPORT SmartsMatcher : public FilterMatcherBase {
|
||||
//! Set the maximum match count for the pattern to be true
|
||||
void setMaxCount(unsigned int val) { d_max_count = val; }
|
||||
|
||||
virtual bool getMatches(const ROMol &mol,
|
||||
std::vector<FilterMatch> &matchVect) const;
|
||||
virtual bool hasMatch(const ROMol &mol) const;
|
||||
virtual boost::shared_ptr<FilterMatcherBase> copy() const {
|
||||
bool getMatches(const ROMol &mol,
|
||||
std::vector<FilterMatch> &matchVect) const override;
|
||||
bool hasMatch(const ROMol &mol) const override;
|
||||
boost::shared_ptr<FilterMatcherBase> copy() const override {
|
||||
return boost::shared_ptr<FilterMatcherBase>(new SmartsMatcher(*this));
|
||||
}
|
||||
|
||||
@@ -390,7 +392,7 @@ class RDKIT_FILTERCATALOG_EXPORT ExclusionList : public FilterMatcherBase {
|
||||
: FilterMatcherBase("Not any of"),
|
||||
d_offPatterns(std::move(offPatterns)) {}
|
||||
|
||||
virtual std::string getName() const {
|
||||
std::string getName() const override {
|
||||
std::string res;
|
||||
res = "(" + FilterMatcherBase::getName();
|
||||
for (size_t i = 0; i < d_offPatterns.size(); ++i) {
|
||||
@@ -400,7 +402,7 @@ class RDKIT_FILTERCATALOG_EXPORT ExclusionList : public FilterMatcherBase {
|
||||
return res;
|
||||
}
|
||||
|
||||
bool isValid() const {
|
||||
bool isValid() const override {
|
||||
for (size_t i = 0; i < d_offPatterns.size(); ++i)
|
||||
if (!d_offPatterns[i]->isValid()) return false;
|
||||
return true;
|
||||
@@ -416,7 +418,7 @@ class RDKIT_FILTERCATALOG_EXPORT ExclusionList : public FilterMatcherBase {
|
||||
d_offPatterns = offPatterns;
|
||||
}
|
||||
|
||||
virtual bool getMatches(const ROMol &mol, std::vector<FilterMatch> &) const {
|
||||
bool getMatches(const ROMol &mol, std::vector<FilterMatch> &) const override {
|
||||
PRECONDITION(isValid(),
|
||||
"ExclusionList: one of the exclusion pattens is invalid");
|
||||
bool result = true;
|
||||
@@ -427,7 +429,7 @@ class RDKIT_FILTERCATALOG_EXPORT ExclusionList : public FilterMatcherBase {
|
||||
return result;
|
||||
}
|
||||
|
||||
virtual bool hasMatch(const ROMol &mol) const {
|
||||
bool hasMatch(const ROMol &mol) const override {
|
||||
PRECONDITION(isValid(),
|
||||
"ExclusionList: one of the exclusion pattens is invalid");
|
||||
bool result = true;
|
||||
@@ -438,7 +440,7 @@ class RDKIT_FILTERCATALOG_EXPORT ExclusionList : public FilterMatcherBase {
|
||||
return result;
|
||||
}
|
||||
|
||||
virtual boost::shared_ptr<FilterMatcherBase> copy() const {
|
||||
boost::shared_ptr<FilterMatcherBase> copy() const override {
|
||||
return boost::shared_ptr<FilterMatcherBase>(new ExclusionList(*this));
|
||||
}
|
||||
|
||||
@@ -474,7 +476,7 @@ class RDKIT_FILTERCATALOG_EXPORT FilterHierarchyMatcher
|
||||
: FilterMatcherBase(), d_matcher(matcher.copy()) {}
|
||||
|
||||
//! Return the name for this node (from the underlying FilterMatcherBase)
|
||||
virtual std::string getName() const {
|
||||
std::string getName() const override {
|
||||
if (d_matcher.get()) {
|
||||
return d_matcher->getName();
|
||||
}
|
||||
@@ -482,7 +484,7 @@ class RDKIT_FILTERCATALOG_EXPORT FilterHierarchyMatcher
|
||||
}
|
||||
|
||||
//! returns true if this node has a valid matcher
|
||||
bool isValid() const { return d_matcher->isValid(); }
|
||||
bool isValid() const override { return d_matcher->isValid(); }
|
||||
|
||||
//! Set a new FilterMatcherBase for this node
|
||||
/*
|
||||
@@ -515,20 +517,20 @@ class RDKIT_FILTERCATALOG_EXPORT FilterHierarchyMatcher
|
||||
\param mol The molecule to match against
|
||||
\param matches The vector of FilterMatch objects that match
|
||||
*/
|
||||
virtual bool getMatches(const ROMol &mol,
|
||||
std::vector<FilterMatch> &matches) const;
|
||||
bool getMatches(const ROMol &mol,
|
||||
std::vector<FilterMatch> &matches) const override;
|
||||
|
||||
//! Does this node match the molecule
|
||||
/*
|
||||
\param mol The molecule to match against
|
||||
*/
|
||||
virtual bool hasMatch(const ROMol &mol) const {
|
||||
bool hasMatch(const ROMol &mol) const override {
|
||||
std::vector<FilterMatch> temp;
|
||||
return getMatches(mol, temp);
|
||||
}
|
||||
|
||||
//! copys the FilterHierarchyMatcher into a FilterMatcherBase
|
||||
virtual boost::shared_ptr<FilterMatcherBase> copy() const {
|
||||
boost::shared_ptr<FilterMatcherBase> copy() const override {
|
||||
return boost::shared_ptr<FilterMatcherBase>(
|
||||
new FilterHierarchyMatcher(*this));
|
||||
}
|
||||
|
||||
@@ -36,10 +36,11 @@ class RDKIT_FINGERPRINTS_EXPORT AtomPairAtomInvGenerator
|
||||
AtomPairAtomInvGenerator(bool includeChirality = false,
|
||||
bool topologicalTorsionCorrection = false);
|
||||
|
||||
std::vector<std::uint32_t> *getAtomInvariants(const ROMol &mol) const;
|
||||
std::vector<std::uint32_t> *getAtomInvariants(
|
||||
const ROMol &mol) const override;
|
||||
|
||||
std::string infoString() const;
|
||||
AtomPairAtomInvGenerator *clone() const;
|
||||
std::string infoString() const override;
|
||||
AtomPairAtomInvGenerator *clone() const override;
|
||||
};
|
||||
|
||||
/*!
|
||||
@@ -55,9 +56,9 @@ class RDKIT_FINGERPRINTS_EXPORT AtomPairArguments
|
||||
const unsigned int d_minDistance;
|
||||
const unsigned int d_maxDistance;
|
||||
|
||||
OutputType getResultSize() const;
|
||||
OutputType getResultSize() const override;
|
||||
|
||||
std::string infoString() const;
|
||||
std::string infoString() const override;
|
||||
|
||||
/*!
|
||||
\brief construct a new AtomPairArguments object
|
||||
@@ -105,7 +106,7 @@ class RDKIT_FINGERPRINTS_EXPORT AtomPairAtomEnv
|
||||
const std::vector<std::uint32_t> *bondInvariants,
|
||||
const AdditionalOutput *additionalOutput,
|
||||
const bool hashResults = false,
|
||||
const std::uint64_t fpSize = 0) const;
|
||||
const std::uint64_t fpSize = 0) const override;
|
||||
|
||||
/*!
|
||||
\brief construct a new AtomPairAtomEnv object
|
||||
@@ -133,9 +134,9 @@ class RDKIT_FINGERPRINTS_EXPORT AtomPairEnvGenerator
|
||||
const AdditionalOutput *additionalOutput,
|
||||
const std::vector<std::uint32_t> *atomInvariants,
|
||||
const std::vector<std::uint32_t> *bondInvariants,
|
||||
const bool hashResults = false) const;
|
||||
const bool hashResults = false) const override;
|
||||
|
||||
std::string infoString() const;
|
||||
std::string infoString() const override;
|
||||
};
|
||||
|
||||
/*!
|
||||
|
||||
@@ -335,7 +335,7 @@ class RDKIT_FINGERPRINTS_EXPORT UnimplementedFPException
|
||||
UnimplementedFPException(std::string msg) : _msg(std::move(msg)) {}
|
||||
//! get the error message
|
||||
const char *what() const noexcept override { return _msg.c_str(); }
|
||||
~UnimplementedFPException() noexcept {}
|
||||
~UnimplementedFPException() noexcept override {}
|
||||
|
||||
private:
|
||||
std::string _msg;
|
||||
|
||||
@@ -37,10 +37,11 @@ class RDKIT_FINGERPRINTS_EXPORT MorganAtomInvGenerator
|
||||
*/
|
||||
MorganAtomInvGenerator(const bool includeRingMembership = true);
|
||||
|
||||
std::vector<std::uint32_t> *getAtomInvariants(const ROMol &mol) const;
|
||||
std::vector<std::uint32_t> *getAtomInvariants(
|
||||
const ROMol &mol) const override;
|
||||
|
||||
std::string infoString() const;
|
||||
MorganAtomInvGenerator *clone() const;
|
||||
std::string infoString() const override;
|
||||
MorganAtomInvGenerator *clone() const override;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -63,10 +64,11 @@ class RDKIT_FINGERPRINTS_EXPORT MorganFeatureAtomInvGenerator
|
||||
*/
|
||||
MorganFeatureAtomInvGenerator(std::vector<const ROMol *> *patterns = nullptr);
|
||||
|
||||
std::vector<std::uint32_t> *getAtomInvariants(const ROMol &mol) const;
|
||||
std::vector<std::uint32_t> *getAtomInvariants(
|
||||
const ROMol &mol) const override;
|
||||
|
||||
std::string infoString() const;
|
||||
MorganFeatureAtomInvGenerator *clone() const;
|
||||
std::string infoString() const override;
|
||||
MorganFeatureAtomInvGenerator *clone() const override;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -90,11 +92,12 @@ class RDKIT_FINGERPRINTS_EXPORT MorganBondInvGenerator
|
||||
MorganBondInvGenerator(const bool useBondTypes = true,
|
||||
const bool useChirality = false);
|
||||
|
||||
std::vector<std::uint32_t> *getBondInvariants(const ROMol &mol) const;
|
||||
std::vector<std::uint32_t> *getBondInvariants(
|
||||
const ROMol &mol) const override;
|
||||
|
||||
std::string infoString() const;
|
||||
MorganBondInvGenerator *clone() const;
|
||||
~MorganBondInvGenerator() {}
|
||||
std::string infoString() const override;
|
||||
MorganBondInvGenerator *clone() const override;
|
||||
~MorganBondInvGenerator() override {}
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -109,9 +112,9 @@ class RDKIT_FINGERPRINTS_EXPORT MorganArguments
|
||||
const bool df_onlyNonzeroInvariants;
|
||||
const unsigned int d_radius;
|
||||
|
||||
OutputType getResultSize() const;
|
||||
OutputType getResultSize() const override;
|
||||
|
||||
std::string infoString() const;
|
||||
std::string infoString() const override;
|
||||
|
||||
/**
|
||||
\brief Construct a new MorganArguments object
|
||||
@@ -153,7 +156,7 @@ class RDKIT_FINGERPRINTS_EXPORT MorganAtomEnv
|
||||
const std::vector<std::uint32_t> *bondInvariants,
|
||||
const AdditionalOutput *additionalOutput,
|
||||
const bool hashResults = false,
|
||||
const std::uint64_t fpSize = 0) const;
|
||||
const std::uint64_t fpSize = 0) const override;
|
||||
|
||||
/**
|
||||
\brief Construct a new MorganAtomEnv object
|
||||
@@ -181,9 +184,9 @@ class RDKIT_FINGERPRINTS_EXPORT MorganEnvGenerator
|
||||
const AdditionalOutput *additionalOutput,
|
||||
const std::vector<std::uint32_t> *atomInvariants,
|
||||
const std::vector<std::uint32_t> *bondInvariants,
|
||||
const bool hashResults = false) const;
|
||||
const bool hashResults = false) const override;
|
||||
|
||||
std::string infoString() const;
|
||||
std::string infoString() const override;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,9 +27,9 @@ class RDKIT_FINGERPRINTS_EXPORT RDKitFPArguments
|
||||
const bool df_branchedPaths;
|
||||
const bool df_useBondOrder;
|
||||
|
||||
OutputType getResultSize() const;
|
||||
OutputType getResultSize() const override;
|
||||
|
||||
std::string infoString() const;
|
||||
std::string infoString() const override;
|
||||
|
||||
/**
|
||||
\brief Construct a new RDKitFPArguments object
|
||||
@@ -60,10 +60,11 @@ class RDKIT_FINGERPRINTS_EXPORT RDKitFPArguments
|
||||
class RDKIT_FINGERPRINTS_EXPORT RDKitFPAtomInvGenerator
|
||||
: public AtomInvariantsGenerator {
|
||||
public:
|
||||
std::vector<std::uint32_t> *getAtomInvariants(const ROMol &mol) const;
|
||||
std::vector<std::uint32_t> *getAtomInvariants(
|
||||
const ROMol &mol) const override;
|
||||
|
||||
std::string infoString() const;
|
||||
RDKitFPAtomInvGenerator *clone() const;
|
||||
std::string infoString() const override;
|
||||
RDKitFPAtomInvGenerator *clone() const override;
|
||||
};
|
||||
|
||||
template <typename OutputType>
|
||||
@@ -79,7 +80,7 @@ class RDKIT_FINGERPRINTS_EXPORT RDKitFPAtomEnv
|
||||
const std::vector<std::uint32_t> *bondInvariants,
|
||||
const AdditionalOutput *additionalOutput,
|
||||
bool hashResults = false,
|
||||
const std::uint64_t fpSize = 0) const;
|
||||
const std::uint64_t fpSize = 0) const override;
|
||||
|
||||
/**
|
||||
\brief Construct a new RDKitFPAtomEnv object
|
||||
@@ -107,9 +108,9 @@ class RDKIT_FINGERPRINTS_EXPORT RDKitFPEnvGenerator
|
||||
const AdditionalOutput *additionalOutput,
|
||||
const std::vector<std::uint32_t> *atomInvariants,
|
||||
const std::vector<std::uint32_t> *bondInvariants,
|
||||
bool hashResults = false) const;
|
||||
bool hashResults = false) const override;
|
||||
|
||||
std::string infoString() const;
|
||||
std::string infoString() const override;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,9 +25,9 @@ class RDKIT_FINGERPRINTS_EXPORT TopologicalTorsionArguments
|
||||
const bool df_includeChirality;
|
||||
const uint32_t d_torsionAtomCount;
|
||||
|
||||
OutputType getResultSize() const;
|
||||
OutputType getResultSize() const override;
|
||||
|
||||
std::string infoString() const;
|
||||
std::string infoString() const override;
|
||||
|
||||
/**
|
||||
\brief Construct a new Topological Torsion Arguments object
|
||||
@@ -60,7 +60,7 @@ class RDKIT_FINGERPRINTS_EXPORT TopologicalTorsionAtomEnv
|
||||
const std::vector<std::uint32_t> *bondInvariants,
|
||||
const AdditionalOutput *additionalOutput,
|
||||
const bool hashResults = false,
|
||||
const std::uint64_t fpSize = 0) const;
|
||||
const std::uint64_t fpSize = 0) const override;
|
||||
/**
|
||||
\brief Construct a new Topological Torsion Atom Env object
|
||||
|
||||
@@ -81,9 +81,9 @@ class RDKIT_FINGERPRINTS_EXPORT TopologicalTorsionEnvGenerator
|
||||
const AdditionalOutput *additionalOutput,
|
||||
const std::vector<std::uint32_t> *atomInvariants,
|
||||
const std::vector<std::uint32_t> *bondInvariants,
|
||||
const bool hashResults = false) const;
|
||||
const bool hashResults = false) const override;
|
||||
|
||||
std::string infoString() const;
|
||||
std::string infoString() const override;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -51,9 +51,9 @@ class RDKIT_FORCEFIELDHELPERS_EXPORT TorsionAngleContribM6
|
||||
TorsionAngleContribM6(ForceFields::ForceField *owner, unsigned int idx1,
|
||||
unsigned int idx2, unsigned int idx3, unsigned int idx4,
|
||||
std::vector<double> V, std::vector<int> signs);
|
||||
double getEnergy(double *pos) const;
|
||||
void getGrad(double *pos, double *grad) const;
|
||||
virtual TorsionAngleContribM6 *copy() const {
|
||||
double getEnergy(double *pos) const override;
|
||||
void getGrad(double *pos, double *grad) const override;
|
||||
TorsionAngleContribM6 *copy() const override {
|
||||
return new TorsionAngleContribM6(*this);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ class RDKIT_FRAGCATALOG_EXPORT FragCatParams : public RDCatalog::CatalogParams {
|
||||
//! construct from a pickle string (serialized representation)
|
||||
FragCatParams(const std::string &pickle);
|
||||
|
||||
~FragCatParams();
|
||||
~FragCatParams() override;
|
||||
|
||||
//! returns our lower fragment length
|
||||
unsigned int getLowerFragLength() const { return d_lowerFragLen; }
|
||||
@@ -75,10 +75,10 @@ class RDKIT_FRAGCATALOG_EXPORT FragCatParams : public RDCatalog::CatalogParams {
|
||||
//! returns a pointer to a specific functional group
|
||||
const ROMol *getFuncGroup(unsigned int fid) const;
|
||||
|
||||
void toStream(std::ostream &) const;
|
||||
std::string Serialize() const;
|
||||
void initFromStream(std::istream &ss);
|
||||
void initFromString(const std::string &text);
|
||||
void toStream(std::ostream &) const override;
|
||||
std::string Serialize() const override;
|
||||
void initFromStream(std::istream &ss) override;
|
||||
void initFromString(const std::string &text) override;
|
||||
|
||||
private:
|
||||
unsigned int d_lowerFragLen;
|
||||
|
||||
@@ -36,7 +36,7 @@ class RDKIT_FRAGCATALOG_EXPORT FragCatalogEntry
|
||||
const MatchVectType &aidToFid);
|
||||
FragCatalogEntry(const std::string &pickle);
|
||||
|
||||
~FragCatalogEntry() {
|
||||
~FragCatalogEntry() override {
|
||||
delete dp_mol;
|
||||
dp_mol = nullptr;
|
||||
if (dp_props) {
|
||||
@@ -45,7 +45,7 @@ class RDKIT_FRAGCATALOG_EXPORT FragCatalogEntry
|
||||
}
|
||||
}
|
||||
|
||||
std::string getDescription() const { return d_descrip; }
|
||||
std::string getDescription() const override { return d_descrip; }
|
||||
|
||||
void setDescription(const std::string &val) { d_descrip = val; }
|
||||
|
||||
@@ -111,10 +111,10 @@ class RDKIT_FRAGCATALOG_EXPORT FragCatalogEntry
|
||||
|
||||
void clearProp(const std::string &key) const { clearProp(key.c_str()); }
|
||||
|
||||
void toStream(std::ostream &ss) const;
|
||||
std::string Serialize() const;
|
||||
void initFromStream(std::istream &ss);
|
||||
void initFromString(const std::string &text);
|
||||
void toStream(std::ostream &ss) const override;
|
||||
std::string Serialize() const override;
|
||||
void initFromStream(std::istream &ss) override;
|
||||
void initFromString(const std::string &text) override;
|
||||
|
||||
private:
|
||||
ROMol *dp_mol{nullptr};
|
||||
|
||||
@@ -29,7 +29,7 @@ class RDKIT_MOLALIGN_EXPORT MolAlignException : public std::exception {
|
||||
MolAlignException(const std::string msg) : _msg(msg) {}
|
||||
//! get the error message
|
||||
const char *what() const noexcept override { return _msg.c_str(); }
|
||||
~MolAlignException() noexcept {}
|
||||
~MolAlignException() noexcept override {}
|
||||
|
||||
private:
|
||||
std::string _msg;
|
||||
|
||||
@@ -33,9 +33,9 @@ class RDKIT_MOLCATALOG_EXPORT MolCatalogEntry : public RDCatalog::CatalogEntry {
|
||||
//! construct from a pickle
|
||||
MolCatalogEntry(const std::string &pickle) { this->initFromString(pickle); }
|
||||
|
||||
~MolCatalogEntry();
|
||||
~MolCatalogEntry() override;
|
||||
|
||||
std::string getDescription() const { return d_descrip; }
|
||||
std::string getDescription() const override { return d_descrip; }
|
||||
|
||||
void setDescription(std::string val) { d_descrip = val; }
|
||||
|
||||
@@ -87,13 +87,13 @@ class RDKIT_MOLCATALOG_EXPORT MolCatalogEntry : public RDCatalog::CatalogEntry {
|
||||
void clearProp(const std::string &key) const { clearProp(key.c_str()); }
|
||||
|
||||
//! serializes this entry to the stream
|
||||
void toStream(std::ostream &ss) const;
|
||||
void toStream(std::ostream &ss) const override;
|
||||
//! returns a serialized (pickled) form of the entry
|
||||
std::string Serialize() const;
|
||||
std::string Serialize() const override;
|
||||
//! initialize from a stream containing a pickle
|
||||
void initFromStream(std::istream &ss);
|
||||
void initFromStream(std::istream &ss) override;
|
||||
//! initialize from a string containing a pickle
|
||||
void initFromString(const std::string &text);
|
||||
void initFromString(const std::string &text) override;
|
||||
|
||||
private:
|
||||
const ROMol *dp_mol{nullptr};
|
||||
|
||||
@@ -17,7 +17,7 @@ class RDKIT_MOLCATALOG_EXPORT MolCatalogParams
|
||||
public:
|
||||
MolCatalogParams() { d_typeStr = "MolCatalog Parameters"; }
|
||||
|
||||
~MolCatalogParams();
|
||||
~MolCatalogParams() override;
|
||||
|
||||
//! copy constructor
|
||||
MolCatalogParams(const MolCatalogParams &other) {
|
||||
@@ -27,13 +27,13 @@ class RDKIT_MOLCATALOG_EXPORT MolCatalogParams
|
||||
MolCatalogParams(const std::string &pickle);
|
||||
|
||||
//! serializes to the stream
|
||||
void toStream(std::ostream &) const;
|
||||
void toStream(std::ostream &) const override;
|
||||
//! returns a serialized (pickled) form
|
||||
std::string Serialize() const;
|
||||
std::string Serialize() const override;
|
||||
//! initialize from a stream containing a pickle
|
||||
void initFromStream(std::istream &ss);
|
||||
void initFromStream(std::istream &ss) override;
|
||||
//! initialize from a string containing a pickle
|
||||
void initFromString(const std::string &text);
|
||||
void initFromString(const std::string &text) override;
|
||||
};
|
||||
} // namespace RDKit
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ class RDKIT_MOLCHEMICALFEATURES_EXPORT FeatureFileParseException
|
||||
unsigned int lineNo() const { return d_lineNo; }
|
||||
std::string line() const { return d_line; }
|
||||
const char *what() const noexcept override { return d_msg.c_str(); }
|
||||
~FeatureFileParseException() noexcept {}
|
||||
~FeatureFileParseException() noexcept override {}
|
||||
|
||||
private:
|
||||
unsigned int d_lineNo;
|
||||
|
||||
@@ -40,15 +40,15 @@ class RDKIT_MOLCHEMICALFEATURES_EXPORT MolChemicalFeature
|
||||
d_id(id),
|
||||
d_activeConf(-1) {}
|
||||
|
||||
~MolChemicalFeature() {}
|
||||
~MolChemicalFeature() override {}
|
||||
|
||||
//! \brief return the name of the feature's family
|
||||
const std::string &getFamily() const;
|
||||
const std::string &getFamily() const override;
|
||||
//! \brief return the name of the feature's type
|
||||
const std::string &getType() const;
|
||||
const std::string &getType() const override;
|
||||
//! \brief return the position of the feature (obtained from
|
||||
//! from the associated conformation
|
||||
RDGeom::Point3D getPos() const;
|
||||
RDGeom::Point3D getPos() const override;
|
||||
|
||||
//! \brief return the position of the feature (obtained from
|
||||
//! from the requested conformation from the associated molecule)
|
||||
@@ -61,7 +61,7 @@ class RDKIT_MOLCHEMICALFEATURES_EXPORT MolChemicalFeature
|
||||
const MolChemicalFeatureDef *getFeatDef() const { return dp_def; }
|
||||
|
||||
//! \brief returns the active conformer (in the associated molecule)
|
||||
int getId() const { return d_id; }
|
||||
int getId() const override { return d_id; }
|
||||
|
||||
//! \brief returns the number of atoms defining the feature
|
||||
inline unsigned int getNumAtoms() const { return d_atoms.size(); }
|
||||
|
||||
@@ -33,7 +33,7 @@ class RDKIT_MOLDRAW2D_EXPORT DrawTextFT : public DrawText {
|
||||
public:
|
||||
DrawTextFT(double max_fnt_sz, double min_fnt_sz,
|
||||
const std::string &font_file);
|
||||
~DrawTextFT();
|
||||
~DrawTextFT() override;
|
||||
|
||||
void drawChar(char c, const Point2D &cds) override;
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class DrawTextFTSVG : public DrawTextFT {
|
||||
|
||||
protected:
|
||||
// adds x_trans_ and y_trans_ to coords returns x advance distance
|
||||
virtual double extractOutline() override;
|
||||
double extractOutline() override;
|
||||
|
||||
private:
|
||||
std::ostream &oss_;
|
||||
|
||||
@@ -96,8 +96,8 @@ class RDKIT_MOLDRAW2D_EXPORT MolDraw2DSVG : public MolDraw2D {
|
||||
*bond_colours = nullptr) override;
|
||||
void drawAtomLabel(int atom_num, const DrawColour &draw_colour) override;
|
||||
//! DEPRECATED
|
||||
virtual void drawAnnotation(const std::string ¬e,
|
||||
const StringRect ¬e_rect) override {
|
||||
void drawAnnotation(const std::string ¬e,
|
||||
const StringRect ¬e_rect) override {
|
||||
AnnotationType annot;
|
||||
annot.text_ = note;
|
||||
annot.rect_ = note_rect;
|
||||
|
||||
@@ -41,7 +41,7 @@ class RDKIT_GRAPHMOL_EXPORT MolPicklerException : public std::exception {
|
||||
MolPicklerException(const char *msg) : _msg(msg) {}
|
||||
MolPicklerException(const std::string msg) : _msg(msg) {}
|
||||
const char *what() const noexcept override { return _msg.c_str(); }
|
||||
~MolPicklerException() noexcept {}
|
||||
~MolPicklerException() noexcept override {}
|
||||
|
||||
private:
|
||||
std::string _msg;
|
||||
|
||||
@@ -41,7 +41,7 @@ class RDKIT_MOLSTANDARDIZE_EXPORT ValidationErrorInfo : public std::exception {
|
||||
BOOST_LOG(rdInfoLog) << d_msg << std::endl;
|
||||
}
|
||||
const char *what() const noexcept override { return d_msg.c_str(); }
|
||||
~ValidationErrorInfo() noexcept {}
|
||||
~ValidationErrorInfo() noexcept override {}
|
||||
|
||||
private:
|
||||
std::string d_msg;
|
||||
@@ -95,7 +95,7 @@ class RDKIT_MOLSTANDARDIZE_EXPORT NoAtomValidation final
|
||||
std::vector<ValidationErrorInfo> &errors) const override;
|
||||
//! makes a copy of NoAtomValidation object and returns a MolVSValidations
|
||||
//! pointer to it
|
||||
virtual boost::shared_ptr<MolVSValidations> copy() const override {
|
||||
boost::shared_ptr<MolVSValidations> copy() const override {
|
||||
return boost::make_shared<NoAtomValidation>(*this);
|
||||
}
|
||||
};
|
||||
@@ -108,7 +108,7 @@ class RDKIT_MOLSTANDARDIZE_EXPORT FragmentValidation final
|
||||
std::vector<ValidationErrorInfo> &errors) const override;
|
||||
//! makes a copy of FragmentValidation object and returns a MolVSValidations
|
||||
//! pointer to it
|
||||
virtual boost::shared_ptr<MolVSValidations> copy() const override {
|
||||
boost::shared_ptr<MolVSValidations> copy() const override {
|
||||
return boost::make_shared<FragmentValidation>(*this);
|
||||
}
|
||||
};
|
||||
@@ -121,7 +121,7 @@ class RDKIT_MOLSTANDARDIZE_EXPORT NeutralValidation final
|
||||
std::vector<ValidationErrorInfo> &errors) const override;
|
||||
//! makes a copy of NeutralValidation object and returns a MolVSValidations
|
||||
//! pointer to it
|
||||
virtual boost::shared_ptr<MolVSValidations> copy() const override {
|
||||
boost::shared_ptr<MolVSValidations> copy() const override {
|
||||
return boost::make_shared<NeutralValidation>(*this);
|
||||
}
|
||||
};
|
||||
@@ -134,7 +134,7 @@ class RDKIT_MOLSTANDARDIZE_EXPORT IsotopeValidation final
|
||||
std::vector<ValidationErrorInfo> &errors) const override;
|
||||
//! makes a copy of IsotopeValidation object and returns a MolVSValidations
|
||||
//! pointer to it
|
||||
virtual boost::shared_ptr<MolVSValidations> copy() const override {
|
||||
boost::shared_ptr<MolVSValidations> copy() const override {
|
||||
return boost::make_shared<IsotopeValidation>(*this);
|
||||
}
|
||||
};
|
||||
@@ -150,7 +150,7 @@ class RDKIT_MOLSTANDARDIZE_EXPORT MolVSValidation : public ValidationMethod {
|
||||
MolVSValidation(
|
||||
const std::vector<boost::shared_ptr<MolVSValidations>> validations);
|
||||
MolVSValidation(const MolVSValidation &other);
|
||||
~MolVSValidation();
|
||||
~MolVSValidation() override;
|
||||
|
||||
std::vector<ValidationErrorInfo> validate(
|
||||
const ROMol &mol, bool reportAllFailures) const override;
|
||||
|
||||
@@ -96,8 +96,9 @@ class PyTautomerEnumeratorCallback
|
||||
inline python::object getCallbackOverride() const {
|
||||
return get_override("__call__");
|
||||
}
|
||||
bool operator()(const ROMol &mol,
|
||||
const MolStandardize::TautomerEnumeratorResult &res) {
|
||||
bool operator()(
|
||||
const ROMol &mol,
|
||||
const MolStandardize::TautomerEnumeratorResult &res) override {
|
||||
PyTautomerEnumeratorResult pyRes(res);
|
||||
return getCallbackOverride()(boost::ref(mol), boost::ref(pyRes));
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ class RDKIT_GRAPHMOL_EXPORT AtomPDBResidueInfo : public AtomMonomerInfo {
|
||||
unsigned int getSegmentNumber() const { return d_segmentNumber; }
|
||||
void setSegmentNumber(unsigned int val) { d_segmentNumber = val; }
|
||||
|
||||
AtomMonomerInfo *copy() const {
|
||||
AtomMonomerInfo *copy() const override {
|
||||
return static_cast<AtomMonomerInfo *>(new AtomPDBResidueInfo(*this));
|
||||
}
|
||||
|
||||
|
||||
@@ -64,21 +64,21 @@ class RDKIT_GRAPHMOL_EXPORT QueryAtom : public Atom {
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
~QueryAtom();
|
||||
~QueryAtom() override;
|
||||
|
||||
//! returns a copy of this query, owned by the caller
|
||||
Atom *copy() const;
|
||||
Atom *copy() const override;
|
||||
|
||||
// This method can be used to distinguish query atoms from standard atoms:
|
||||
bool hasQuery() const { return dp_query != nullptr; }
|
||||
bool hasQuery() const override { return dp_query != nullptr; }
|
||||
|
||||
//! replaces our current query with the value passed in
|
||||
void setQuery(QUERYATOM_QUERY *what) {
|
||||
void setQuery(QUERYATOM_QUERY *what) override {
|
||||
delete dp_query;
|
||||
dp_query = what;
|
||||
}
|
||||
//! returns our current query
|
||||
QUERYATOM_QUERY *getQuery() const { return dp_query; }
|
||||
QUERYATOM_QUERY *getQuery() const override { return dp_query; }
|
||||
|
||||
//! expands our current query
|
||||
/*!
|
||||
@@ -99,10 +99,10 @@ class RDKIT_GRAPHMOL_EXPORT QueryAtom : public Atom {
|
||||
*/
|
||||
void expandQuery(QUERYATOM_QUERY *what,
|
||||
Queries::CompositeQueryType how = Queries::COMPOSITE_AND,
|
||||
bool maintainOrder = true);
|
||||
bool maintainOrder = true) override;
|
||||
|
||||
//! returns true if we match Atom \c what
|
||||
bool Match(Atom const *what) const;
|
||||
bool Match(Atom const *what) const override;
|
||||
|
||||
//! returns true if our query details match those of QueryAtom \c what
|
||||
bool QueryMatch(QueryAtom const *what) const;
|
||||
|
||||
@@ -42,10 +42,10 @@ class RDKIT_GRAPHMOL_EXPORT QueryBond : public Bond {
|
||||
dp_query = nullptr;
|
||||
}
|
||||
}
|
||||
~QueryBond();
|
||||
~QueryBond() override;
|
||||
|
||||
//! returns a copy of this query, owned by the caller
|
||||
virtual Bond *copy() const;
|
||||
Bond *copy() const override;
|
||||
|
||||
QueryBond &operator=(const QueryBond &other);
|
||||
|
||||
@@ -55,18 +55,18 @@ class RDKIT_GRAPHMOL_EXPORT QueryBond : public Bond {
|
||||
void setBondDir(BondDir bD);
|
||||
|
||||
//! returns true if we match Bond \c what
|
||||
bool Match(Bond const *what) const;
|
||||
bool Match(Bond const *what) const override;
|
||||
|
||||
//! returns true if our query details match those of QueryBond \c what
|
||||
bool QueryMatch(QueryBond const *what) const;
|
||||
|
||||
// This method can be used to distinguish query bonds from standard bonds
|
||||
bool hasQuery() const { return dp_query != nullptr; }
|
||||
bool hasQuery() const override { return dp_query != nullptr; }
|
||||
|
||||
//! returns our current query
|
||||
QUERYBOND_QUERY *getQuery() const { return dp_query; }
|
||||
QUERYBOND_QUERY *getQuery() const override { return dp_query; }
|
||||
//! replaces our current query with the value passed in
|
||||
void setQuery(QUERYBOND_QUERY *what) {
|
||||
void setQuery(QUERYBOND_QUERY *what) override {
|
||||
// free up any existing query (Issue255):
|
||||
delete dp_query;
|
||||
dp_query = what;
|
||||
@@ -92,7 +92,7 @@ class RDKIT_GRAPHMOL_EXPORT QueryBond : public Bond {
|
||||
*/
|
||||
void expandQuery(QUERYBOND_QUERY *what,
|
||||
Queries::CompositeQueryType how = Queries::COMPOSITE_AND,
|
||||
bool maintainOrder = true);
|
||||
bool maintainOrder = true) override;
|
||||
|
||||
protected:
|
||||
QUERYBOND_QUERY *dp_query{nullptr};
|
||||
|
||||
@@ -713,7 +713,7 @@ class RDKIT_GRAPHMOL_EXPORT AtomRingQuery
|
||||
this->setDataFunc(queryAtomRingMembership);
|
||||
}
|
||||
|
||||
virtual bool Match(const ConstAtomPtr what) const {
|
||||
bool Match(const ConstAtomPtr what) const override {
|
||||
int v = this->TypeConvert(what, Queries::Int2Type<true>());
|
||||
bool res;
|
||||
if (this->d_val < 0) {
|
||||
@@ -728,7 +728,7 @@ class RDKIT_GRAPHMOL_EXPORT AtomRingQuery
|
||||
}
|
||||
|
||||
//! returns a copy of this query
|
||||
Queries::Query<int, ConstAtomPtr, true> *copy() const {
|
||||
Queries::Query<int, ConstAtomPtr, true> *copy() const override {
|
||||
AtomRingQuery *res = new AtomRingQuery(this->d_val);
|
||||
res->setNegation(getNegation());
|
||||
res->setTol(this->getTol());
|
||||
@@ -774,7 +774,7 @@ class RDKIT_GRAPHMOL_EXPORT RecursiveStructureQuery
|
||||
ROMol const *getQueryMol() const { return dp_queryMol.get(); }
|
||||
|
||||
//! returns a copy of this query
|
||||
Queries::Query<int, Atom const *, true> *copy() const {
|
||||
Queries::Query<int, Atom const *, true> *copy() const override {
|
||||
RecursiveStructureQuery *res = new RecursiveStructureQuery();
|
||||
res->dp_queryMol.reset(new ROMol(*dp_queryMol, true));
|
||||
|
||||
@@ -826,7 +826,7 @@ class HasPropQuery : public Queries::EqualityQuery<int, TargetPtr, true> {
|
||||
this->setDataFunc(nullptr);
|
||||
}
|
||||
|
||||
virtual bool Match(const TargetPtr what) const {
|
||||
bool Match(const TargetPtr what) const override {
|
||||
bool res = what->hasProp(propname);
|
||||
if (this->getNegation()) {
|
||||
res = !res;
|
||||
@@ -835,7 +835,7 @@ class HasPropQuery : public Queries::EqualityQuery<int, TargetPtr, true> {
|
||||
}
|
||||
|
||||
//! returns a copy of this query
|
||||
Queries::Query<int, TargetPtr, true> *copy() const {
|
||||
Queries::Query<int, TargetPtr, true> *copy() const override {
|
||||
HasPropQuery *res = new HasPropQuery(this->propname);
|
||||
res->setNegation(this->getNegation());
|
||||
res->d_description = this->d_description;
|
||||
@@ -879,7 +879,7 @@ class HasPropWithValueQuery
|
||||
this->setDataFunc(nullptr);
|
||||
}
|
||||
|
||||
virtual bool Match(const TargetPtr what) const {
|
||||
bool Match(const TargetPtr what) const override {
|
||||
bool res = what->hasProp(propname);
|
||||
if (res) {
|
||||
try {
|
||||
@@ -912,7 +912,7 @@ class HasPropWithValueQuery
|
||||
}
|
||||
|
||||
//! returns a copy of this query
|
||||
Queries::Query<int, TargetPtr, true> *copy() const {
|
||||
Queries::Query<int, TargetPtr, true> *copy() const override {
|
||||
HasPropWithValueQuery *res =
|
||||
new HasPropWithValueQuery(this->propname, this->val, this->tolerance);
|
||||
res->setNegation(this->getNegation());
|
||||
@@ -945,7 +945,7 @@ class HasPropWithValueQuery<TargetPtr, std::string>
|
||||
this->setDataFunc(nullptr);
|
||||
}
|
||||
|
||||
virtual bool Match(const TargetPtr what) const {
|
||||
bool Match(const TargetPtr what) const override {
|
||||
bool res = what->hasProp(propname);
|
||||
if (res) {
|
||||
try {
|
||||
@@ -978,7 +978,7 @@ class HasPropWithValueQuery<TargetPtr, std::string>
|
||||
}
|
||||
|
||||
//! returns a copy of this query
|
||||
Queries::Query<int, TargetPtr, true> *copy() const {
|
||||
Queries::Query<int, TargetPtr, true> *copy() const override {
|
||||
HasPropWithValueQuery<TargetPtr, std::string> *res =
|
||||
new HasPropWithValueQuery<TargetPtr, std::string>(this->propname,
|
||||
this->val);
|
||||
@@ -1012,7 +1012,7 @@ class HasPropWithValueQuery<TargetPtr, ExplicitBitVect>
|
||||
this->setDataFunc(nullptr);
|
||||
}
|
||||
|
||||
virtual bool Match(const TargetPtr what) const {
|
||||
bool Match(const TargetPtr what) const override {
|
||||
bool res = what->hasProp(propname);
|
||||
if (res) {
|
||||
try {
|
||||
@@ -1047,7 +1047,7 @@ class HasPropWithValueQuery<TargetPtr, ExplicitBitVect>
|
||||
}
|
||||
|
||||
//! returns a copy of this query
|
||||
Queries::Query<int, TargetPtr, true> *copy() const {
|
||||
Queries::Query<int, TargetPtr, true> *copy() const override {
|
||||
HasPropWithValueQuery<TargetPtr, ExplicitBitVect> *res =
|
||||
new HasPropWithValueQuery<TargetPtr, ExplicitBitVect>(
|
||||
this->propname, this->val, this->tol);
|
||||
|
||||
@@ -60,7 +60,7 @@ class RDKIT_SLNPARSE_EXPORT SLNParseException : public std::exception {
|
||||
SLNParseException(const char *msg) : _msg(msg) {}
|
||||
SLNParseException(std::string msg) : _msg(std::move(msg)) {}
|
||||
const char *what() const noexcept override { return _msg.c_str(); }
|
||||
~SLNParseException() noexcept {}
|
||||
~SLNParseException() noexcept override {}
|
||||
|
||||
private:
|
||||
std::string _msg;
|
||||
|
||||
@@ -31,8 +31,8 @@ class RDKIT_GRAPHMOL_EXPORT MolSanitizeException : public std::exception {
|
||||
MolSanitizeException(std::string msg) : d_msg(std::move(msg)) {}
|
||||
MolSanitizeException(const MolSanitizeException &other)
|
||||
: d_msg(other.d_msg) {}
|
||||
virtual const char *what() const noexcept override { return d_msg.c_str(); }
|
||||
virtual ~MolSanitizeException() noexcept {}
|
||||
const char *what() const noexcept override { return d_msg.c_str(); }
|
||||
~MolSanitizeException() noexcept override {}
|
||||
virtual MolSanitizeException *copy() const {
|
||||
return new MolSanitizeException(*this);
|
||||
}
|
||||
@@ -52,11 +52,11 @@ class RDKIT_GRAPHMOL_EXPORT AtomSanitizeException
|
||||
AtomSanitizeException(const AtomSanitizeException &other)
|
||||
: MolSanitizeException(other), d_atomIdx(other.d_atomIdx) {}
|
||||
unsigned int getAtomIdx() const { return d_atomIdx; }
|
||||
virtual ~AtomSanitizeException() noexcept {}
|
||||
virtual MolSanitizeException *copy() const {
|
||||
~AtomSanitizeException() noexcept override {}
|
||||
MolSanitizeException *copy() const override {
|
||||
return new AtomSanitizeException(*this);
|
||||
}
|
||||
virtual std::string getType() const { return "AtomSanitizeException"; }
|
||||
std::string getType() const override { return "AtomSanitizeException"; }
|
||||
|
||||
protected:
|
||||
unsigned int d_atomIdx;
|
||||
@@ -71,9 +71,11 @@ class RDKIT_GRAPHMOL_EXPORT AtomValenceException
|
||||
: AtomSanitizeException(msg, atomIdx) {}
|
||||
AtomValenceException(const AtomValenceException &other)
|
||||
: AtomSanitizeException(other) {}
|
||||
virtual ~AtomValenceException() noexcept {}
|
||||
MolSanitizeException *copy() const { return new AtomValenceException(*this); }
|
||||
std::string getType() const { return "AtomValenceException"; }
|
||||
~AtomValenceException() noexcept override {}
|
||||
MolSanitizeException *copy() const override {
|
||||
return new AtomValenceException(*this);
|
||||
}
|
||||
std::string getType() const override { return "AtomValenceException"; }
|
||||
};
|
||||
|
||||
class RDKIT_GRAPHMOL_EXPORT AtomKekulizeException
|
||||
@@ -85,11 +87,11 @@ class RDKIT_GRAPHMOL_EXPORT AtomKekulizeException
|
||||
: AtomSanitizeException(msg, atomIdx) {}
|
||||
AtomKekulizeException(const AtomKekulizeException &other)
|
||||
: AtomSanitizeException(other) {}
|
||||
virtual ~AtomKekulizeException() noexcept {}
|
||||
MolSanitizeException *copy() const {
|
||||
~AtomKekulizeException() noexcept override {}
|
||||
MolSanitizeException *copy() const override {
|
||||
return new AtomKekulizeException(*this);
|
||||
}
|
||||
std::string getType() const { return "AtomKekulizeException"; }
|
||||
std::string getType() const override { return "AtomKekulizeException"; }
|
||||
};
|
||||
|
||||
class RDKIT_GRAPHMOL_EXPORT KekulizeException : public MolSanitizeException {
|
||||
@@ -103,9 +105,11 @@ class RDKIT_GRAPHMOL_EXPORT KekulizeException : public MolSanitizeException {
|
||||
const std::vector<unsigned int> &getAtomIndices() const {
|
||||
return d_atomIndices;
|
||||
}
|
||||
virtual ~KekulizeException() noexcept {}
|
||||
MolSanitizeException *copy() const { return new KekulizeException(*this); }
|
||||
std::string getType() const { return "KekulizeException"; }
|
||||
~KekulizeException() noexcept override {}
|
||||
MolSanitizeException *copy() const override {
|
||||
return new KekulizeException(*this);
|
||||
}
|
||||
std::string getType() const override { return "KekulizeException"; }
|
||||
|
||||
protected:
|
||||
std::vector<unsigned int> d_atomIndices;
|
||||
|
||||
@@ -105,7 +105,7 @@ class RDKIT_SMILESPARSE_EXPORT SmilesParseException : public std::exception {
|
||||
SmilesParseException(const char *msg) : _msg(msg) {}
|
||||
SmilesParseException(const std::string msg) : _msg(msg) {}
|
||||
const char *what() const noexcept override { return _msg.c_str(); }
|
||||
~SmilesParseException() noexcept {}
|
||||
~SmilesParseException() noexcept override {}
|
||||
|
||||
private:
|
||||
std::string _msg;
|
||||
|
||||
@@ -33,11 +33,11 @@ class _IsSubstructOf : public Catch::MatcherBase<const ROMol &> {
|
||||
_IsSubstructOf(const ROMol &m, SubstructMatchParameters ps)
|
||||
: m_mol(&m), m_ps(std::move(ps)) {}
|
||||
|
||||
virtual bool match(const ROMol &query) const override {
|
||||
bool match(const ROMol &query) const override {
|
||||
return !SubstructMatch(*m_mol, query, m_ps).empty();
|
||||
}
|
||||
|
||||
virtual std::string describe() const override {
|
||||
std::string describe() const override {
|
||||
std::ostringstream ss;
|
||||
ss << "is not a substructure of " << MolToCXSmiles(*m_mol);
|
||||
return ss.str();
|
||||
|
||||
@@ -79,17 +79,17 @@ class RDKIT_SUBSTRUCTLIBRARY_EXPORT MolHolder : public MolHolderBase {
|
||||
public:
|
||||
MolHolder() : MolHolderBase(), mols() {}
|
||||
|
||||
virtual unsigned int addMol(const ROMol &m) {
|
||||
unsigned int addMol(const ROMol &m) override {
|
||||
mols.push_back(boost::make_shared<ROMol>(m));
|
||||
return size() - 1;
|
||||
}
|
||||
|
||||
virtual boost::shared_ptr<ROMol> getMol(unsigned int idx) const {
|
||||
boost::shared_ptr<ROMol> getMol(unsigned int idx) const override {
|
||||
if (idx >= mols.size()) throw IndexErrorException(idx);
|
||||
return mols[idx];
|
||||
}
|
||||
|
||||
virtual unsigned int size() const {
|
||||
unsigned int size() const override {
|
||||
return rdcast<unsigned int>(mols.size());
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ class RDKIT_SUBSTRUCTLIBRARY_EXPORT CachedMolHolder : public MolHolderBase {
|
||||
public:
|
||||
CachedMolHolder() : MolHolderBase(), mols() {}
|
||||
|
||||
virtual unsigned int addMol(const ROMol &m) {
|
||||
unsigned int addMol(const ROMol &m) override {
|
||||
mols.emplace_back();
|
||||
MolPickler::pickleMol(m, mols.back());
|
||||
return size() - 1;
|
||||
@@ -124,14 +124,14 @@ class RDKIT_SUBSTRUCTLIBRARY_EXPORT CachedMolHolder : public MolHolderBase {
|
||||
return size() - 1;
|
||||
}
|
||||
|
||||
virtual boost::shared_ptr<ROMol> getMol(unsigned int idx) const {
|
||||
boost::shared_ptr<ROMol> getMol(unsigned int idx) const override {
|
||||
if (idx >= mols.size()) throw IndexErrorException(idx);
|
||||
boost::shared_ptr<ROMol> mol(new ROMol);
|
||||
MolPickler::molFromPickle(mols[idx], mol.get());
|
||||
return mol;
|
||||
}
|
||||
|
||||
virtual unsigned int size() const {
|
||||
unsigned int size() const override {
|
||||
return rdcast<unsigned int>(mols.size());
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ class RDKIT_SUBSTRUCTLIBRARY_EXPORT CachedSmilesMolHolder
|
||||
public:
|
||||
CachedSmilesMolHolder() : MolHolderBase(), mols() {}
|
||||
|
||||
virtual unsigned int addMol(const ROMol &m) {
|
||||
unsigned int addMol(const ROMol &m) override {
|
||||
bool doIsomericSmiles = true;
|
||||
mols.push_back(MolToSmiles(m, doIsomericSmiles));
|
||||
return size() - 1;
|
||||
@@ -168,14 +168,14 @@ class RDKIT_SUBSTRUCTLIBRARY_EXPORT CachedSmilesMolHolder
|
||||
return size() - 1;
|
||||
}
|
||||
|
||||
virtual boost::shared_ptr<ROMol> getMol(unsigned int idx) const {
|
||||
boost::shared_ptr<ROMol> getMol(unsigned int idx) const override {
|
||||
if (idx >= mols.size()) throw IndexErrorException(idx);
|
||||
|
||||
boost::shared_ptr<ROMol> mol(SmilesToMol(mols[idx]));
|
||||
return mol;
|
||||
}
|
||||
|
||||
virtual unsigned int size() const {
|
||||
unsigned int size() const override {
|
||||
return rdcast<unsigned int>(mols.size());
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ class RDKIT_SUBSTRUCTLIBRARY_EXPORT CachedTrustedSmilesMolHolder
|
||||
public:
|
||||
CachedTrustedSmilesMolHolder() : MolHolderBase(), mols() {}
|
||||
|
||||
virtual unsigned int addMol(const ROMol &m) {
|
||||
unsigned int addMol(const ROMol &m) override {
|
||||
bool doIsomericSmiles = true;
|
||||
mols.push_back(MolToSmiles(m, doIsomericSmiles));
|
||||
return size() - 1;
|
||||
@@ -217,7 +217,7 @@ class RDKIT_SUBSTRUCTLIBRARY_EXPORT CachedTrustedSmilesMolHolder
|
||||
return size() - 1;
|
||||
}
|
||||
|
||||
virtual boost::shared_ptr<ROMol> getMol(unsigned int idx) const {
|
||||
boost::shared_ptr<ROMol> getMol(unsigned int idx) const override {
|
||||
if (idx >= mols.size()) throw IndexErrorException(idx);
|
||||
|
||||
RWMol *m = SmilesToMol(mols[idx], 0, false);
|
||||
@@ -227,7 +227,7 @@ class RDKIT_SUBSTRUCTLIBRARY_EXPORT CachedTrustedSmilesMolHolder
|
||||
return boost::shared_ptr<ROMol>(m);
|
||||
}
|
||||
|
||||
virtual unsigned int size() const {
|
||||
unsigned int size() const override {
|
||||
return rdcast<unsigned int>(mols.size());
|
||||
}
|
||||
|
||||
@@ -298,7 +298,7 @@ class RDKIT_SUBSTRUCTLIBRARY_EXPORT PatternHolder : public FPHolderBase {
|
||||
PatternHolder() : FPHolderBase(), numBits(defaultNumBits()) {}
|
||||
PatternHolder(unsigned int numBits) : FPHolderBase(), numBits(numBits) {}
|
||||
//! Caller owns the vector!
|
||||
virtual ExplicitBitVect *makeFingerprint(const ROMol &m) const {
|
||||
ExplicitBitVect *makeFingerprint(const ROMol &m) const override {
|
||||
return PatternFingerprintMol(m, numBits);
|
||||
}
|
||||
const unsigned int &getNumBits() const { return numBits; };
|
||||
@@ -314,7 +314,7 @@ class RDKIT_SUBSTRUCTLIBRARY_EXPORT TautomerPatternHolder
|
||||
public:
|
||||
TautomerPatternHolder() : PatternHolder() {}
|
||||
TautomerPatternHolder(unsigned int numBits) : PatternHolder(numBits) {}
|
||||
virtual ExplicitBitVect *makeFingerprint(const ROMol &m) const {
|
||||
ExplicitBitVect *makeFingerprint(const ROMol &m) const override {
|
||||
std::vector<unsigned int> *atomCounts = nullptr;
|
||||
ExplicitBitVect *setOnlyBits = nullptr;
|
||||
const bool tautomericFingerprint = true;
|
||||
|
||||
@@ -70,7 +70,7 @@ class PyResonanceMolSupplierCallback
|
||||
inline python::object getCallbackOverride() const {
|
||||
return get_override("__call__");
|
||||
}
|
||||
bool operator()() { return getCallbackOverride()(); }
|
||||
bool operator()() override { return getCallbackOverride()(); }
|
||||
python::object getPyCallbackObject() { return d_pyCallbackObject; }
|
||||
|
||||
private:
|
||||
|
||||
@@ -40,12 +40,12 @@ class _IsSubstructOf : public Catch::MatcherBase<const std::string &> {
|
||||
m_description(std::move(description)),
|
||||
m_ps(std::move(ps)) {}
|
||||
|
||||
virtual bool match(const std::string &smiles) const override {
|
||||
bool match(const std::string &smiles) const override {
|
||||
std::unique_ptr<ROMol> mol(SmilesToMol(smiles));
|
||||
return !SubstructMatch(*mol, *m_query, m_ps).empty();
|
||||
}
|
||||
|
||||
virtual std::string describe() const override {
|
||||
std::string describe() const override {
|
||||
std::ostringstream ss;
|
||||
ss << "is not a substructure of " << m_description;
|
||||
return ss.str();
|
||||
|
||||
@@ -897,13 +897,13 @@ void testGitHub2597() {
|
||||
<< "testGitHub2597" << std::endl;
|
||||
{
|
||||
class MyCallBack : public ResonanceMolSupplierCallback {
|
||||
bool operator()() {
|
||||
bool operator()() override {
|
||||
TEST_ASSERT(getNumConjGrps() == 1);
|
||||
return (getNumStructures(0) < 12);
|
||||
}
|
||||
};
|
||||
class MyCallBack2 : public ResonanceMolSupplierCallback {
|
||||
bool operator()() {
|
||||
bool operator()() override {
|
||||
TEST_ASSERT(getNumConjGrps() == 1);
|
||||
return (getNumDiverseStructures(0) < 8);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ class SquareMatrix : public Matrix<TYPE> {
|
||||
// return d_nRows;
|
||||
// }
|
||||
|
||||
virtual SquareMatrix<TYPE> &operator*=(TYPE scale) {
|
||||
SquareMatrix<TYPE> &operator*=(TYPE scale) override {
|
||||
Matrix<TYPE>::operator*=(scale);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ class RDKIT_QUERY_EXPORT AndQuery
|
||||
typedef Query<MatchFuncArgType, DataFuncArgType, needsConversion> BASE;
|
||||
AndQuery() { this->df_negate = false; }
|
||||
|
||||
bool Match(const DataFuncArgType what) const {
|
||||
bool Match(const DataFuncArgType what) const override {
|
||||
bool res = true;
|
||||
typename BASE::CHILD_VECT_CI it1;
|
||||
for (it1 = this->beginChildren(); it1 != this->endChildren(); ++it1) {
|
||||
@@ -37,7 +37,8 @@ class RDKIT_QUERY_EXPORT AndQuery
|
||||
if (this->getNegation()) res = !res;
|
||||
return res;
|
||||
}
|
||||
Query<MatchFuncArgType, DataFuncArgType, needsConversion> *copy() const {
|
||||
Query<MatchFuncArgType, DataFuncArgType, needsConversion> *copy()
|
||||
const override {
|
||||
AndQuery<MatchFuncArgType, DataFuncArgType, needsConversion> *res =
|
||||
new AndQuery<MatchFuncArgType, DataFuncArgType, needsConversion>();
|
||||
typename BASE::CHILD_VECT_CI i;
|
||||
|
||||
@@ -48,7 +48,7 @@ class RDKIT_QUERY_EXPORT EqualityQuery
|
||||
//! returns out tolerance
|
||||
const MatchFuncArgType getTol() const { return this->d_tol; }
|
||||
|
||||
virtual bool Match(const DataFuncArgType what) const {
|
||||
bool Match(const DataFuncArgType what) const override {
|
||||
MatchFuncArgType mfArg =
|
||||
this->TypeConvert(what, Int2Type<needsConversion>());
|
||||
if (queryCmp(this->d_val, mfArg, this->d_tol) == 0) {
|
||||
@@ -66,8 +66,8 @@ class RDKIT_QUERY_EXPORT EqualityQuery
|
||||
}
|
||||
}
|
||||
|
||||
virtual Query<MatchFuncArgType, DataFuncArgType, needsConversion> *copy()
|
||||
const {
|
||||
Query<MatchFuncArgType, DataFuncArgType, needsConversion> *copy()
|
||||
const override {
|
||||
EqualityQuery<MatchFuncArgType, DataFuncArgType, needsConversion> *res =
|
||||
new EqualityQuery<MatchFuncArgType, DataFuncArgType, needsConversion>();
|
||||
res->setNegation(this->getNegation());
|
||||
@@ -79,7 +79,7 @@ class RDKIT_QUERY_EXPORT EqualityQuery
|
||||
return res;
|
||||
}
|
||||
|
||||
std::string getFullDescription() const {
|
||||
std::string getFullDescription() const override {
|
||||
std::ostringstream res;
|
||||
res << this->getDescription();
|
||||
res << " " << this->d_val;
|
||||
|
||||
@@ -35,7 +35,7 @@ class RDKIT_QUERY_EXPORT GreaterEqualQuery
|
||||
this->df_negate = false;
|
||||
}
|
||||
|
||||
bool Match(const DataFuncArgType what) const {
|
||||
bool Match(const DataFuncArgType what) const override {
|
||||
MatchFuncArgType mfArg =
|
||||
this->TypeConvert(what, Int2Type<needsConversion>());
|
||||
if (queryCmp(this->d_val, mfArg, this->d_tol) >= 0) {
|
||||
@@ -50,7 +50,8 @@ class RDKIT_QUERY_EXPORT GreaterEqualQuery
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Query<MatchFuncArgType, DataFuncArgType, needsConversion> *copy() const {
|
||||
Query<MatchFuncArgType, DataFuncArgType, needsConversion> *copy()
|
||||
const override {
|
||||
GreaterEqualQuery<MatchFuncArgType, DataFuncArgType, needsConversion> *res =
|
||||
new GreaterEqualQuery<MatchFuncArgType, DataFuncArgType,
|
||||
needsConversion>();
|
||||
@@ -63,7 +64,7 @@ class RDKIT_QUERY_EXPORT GreaterEqualQuery
|
||||
return res;
|
||||
}
|
||||
|
||||
std::string getFullDescription() const {
|
||||
std::string getFullDescription() const override {
|
||||
std::ostringstream res;
|
||||
res << this->getDescription();
|
||||
res << " " << this->d_val;
|
||||
|
||||
@@ -35,7 +35,7 @@ class RDKIT_QUERY_EXPORT GreaterQuery
|
||||
this->df_negate = false;
|
||||
}
|
||||
|
||||
bool Match(const DataFuncArgType what) const {
|
||||
bool Match(const DataFuncArgType what) const override {
|
||||
MatchFuncArgType mfArg =
|
||||
this->TypeConvert(what, Int2Type<needsConversion>());
|
||||
if (queryCmp(this->d_val, mfArg, this->d_tol) > 0) {
|
||||
@@ -51,7 +51,8 @@ class RDKIT_QUERY_EXPORT GreaterQuery
|
||||
}
|
||||
}
|
||||
|
||||
Query<MatchFuncArgType, DataFuncArgType, needsConversion> *copy() const {
|
||||
Query<MatchFuncArgType, DataFuncArgType, needsConversion> *copy()
|
||||
const override {
|
||||
GreaterQuery<MatchFuncArgType, DataFuncArgType, needsConversion> *res =
|
||||
new GreaterQuery<MatchFuncArgType, DataFuncArgType, needsConversion>();
|
||||
res->setVal(this->d_val);
|
||||
@@ -63,7 +64,7 @@ class RDKIT_QUERY_EXPORT GreaterQuery
|
||||
return res;
|
||||
}
|
||||
|
||||
std::string getFullDescription() const {
|
||||
std::string getFullDescription() const override {
|
||||
std::ostringstream res;
|
||||
res << this->getDescription();
|
||||
res << " " << this->d_val;
|
||||
|
||||
@@ -35,7 +35,7 @@ class RDKIT_QUERY_EXPORT LessEqualQuery
|
||||
this->df_negate = false;
|
||||
}
|
||||
|
||||
bool Match(const DataFuncArgType what) const {
|
||||
bool Match(const DataFuncArgType what) const override {
|
||||
MatchFuncArgType mfArg =
|
||||
this->TypeConvert(what, Int2Type<needsConversion>());
|
||||
if (queryCmp(this->d_val, mfArg, this->d_tol) <= 0) {
|
||||
@@ -51,7 +51,8 @@ class RDKIT_QUERY_EXPORT LessEqualQuery
|
||||
}
|
||||
}
|
||||
|
||||
Query<MatchFuncArgType, DataFuncArgType, needsConversion> *copy() const {
|
||||
Query<MatchFuncArgType, DataFuncArgType, needsConversion> *copy()
|
||||
const override {
|
||||
LessEqualQuery<MatchFuncArgType, DataFuncArgType, needsConversion> *res =
|
||||
new LessEqualQuery<MatchFuncArgType, DataFuncArgType,
|
||||
needsConversion>();
|
||||
@@ -64,7 +65,7 @@ class RDKIT_QUERY_EXPORT LessEqualQuery
|
||||
return res;
|
||||
}
|
||||
|
||||
std::string getFullDescription() const {
|
||||
std::string getFullDescription() const override {
|
||||
std::ostringstream res;
|
||||
res << this->getDescription();
|
||||
res << " " << this->d_val;
|
||||
|
||||
@@ -35,7 +35,7 @@ class RDKIT_QUERY_EXPORT LessQuery
|
||||
this->df_negate = false;
|
||||
}
|
||||
|
||||
bool Match(const DataFuncArgType what) const {
|
||||
bool Match(const DataFuncArgType what) const override {
|
||||
MatchFuncArgType mfArg =
|
||||
this->TypeConvert(what, Int2Type<needsConversion>());
|
||||
if (queryCmp(this->d_val, mfArg, this->d_tol) < 0) {
|
||||
@@ -51,7 +51,8 @@ class RDKIT_QUERY_EXPORT LessQuery
|
||||
}
|
||||
}
|
||||
|
||||
Query<MatchFuncArgType, DataFuncArgType, needsConversion> *copy() const {
|
||||
Query<MatchFuncArgType, DataFuncArgType, needsConversion> *copy()
|
||||
const override {
|
||||
LessQuery<MatchFuncArgType, DataFuncArgType, needsConversion> *res =
|
||||
new LessQuery<MatchFuncArgType, DataFuncArgType, needsConversion>();
|
||||
res->setNegation(this->getNegation());
|
||||
@@ -63,7 +64,7 @@ class RDKIT_QUERY_EXPORT LessQuery
|
||||
return res;
|
||||
}
|
||||
|
||||
std::string getFullDescription() const {
|
||||
std::string getFullDescription() const override {
|
||||
std::ostringstream res;
|
||||
res << this->getDescription();
|
||||
res << " " << this->d_val;
|
||||
|
||||
@@ -23,7 +23,7 @@ class RDKIT_QUERY_EXPORT OrQuery
|
||||
typedef Query<MatchFuncArgType, DataFuncArgType, needsConversion> BASE;
|
||||
OrQuery() { this->df_negate = false; }
|
||||
|
||||
bool Match(const DataFuncArgType what) const {
|
||||
bool Match(const DataFuncArgType what) const override {
|
||||
bool res = false;
|
||||
typename BASE::CHILD_VECT_CI it1;
|
||||
for (it1 = this->beginChildren(); it1 != this->endChildren(); ++it1) {
|
||||
@@ -37,7 +37,8 @@ class RDKIT_QUERY_EXPORT OrQuery
|
||||
return res;
|
||||
}
|
||||
|
||||
Query<MatchFuncArgType, DataFuncArgType, needsConversion> *copy() const {
|
||||
Query<MatchFuncArgType, DataFuncArgType, needsConversion> *copy()
|
||||
const override {
|
||||
OrQuery<MatchFuncArgType, DataFuncArgType, needsConversion> *res =
|
||||
new OrQuery<MatchFuncArgType, DataFuncArgType, needsConversion>();
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ class RDKIT_QUERY_EXPORT RangeQuery
|
||||
//! returns our tolerance
|
||||
const MatchFuncArgType getTol() const { return this->d_tol; }
|
||||
|
||||
bool Match(const DataFuncArgType what) const {
|
||||
bool Match(const DataFuncArgType what) const override {
|
||||
MatchFuncArgType mfArg =
|
||||
this->TypeConvert(what, Int2Type<needsConversion>());
|
||||
int lCmp = queryCmp(this->d_lower, mfArg, this->d_tol);
|
||||
@@ -80,7 +80,8 @@ class RDKIT_QUERY_EXPORT RangeQuery
|
||||
return !tempR;
|
||||
}
|
||||
|
||||
Query<MatchFuncArgType, DataFuncArgType, needsConversion> *copy() const {
|
||||
Query<MatchFuncArgType, DataFuncArgType, needsConversion> *copy()
|
||||
const override {
|
||||
RangeQuery<MatchFuncArgType, DataFuncArgType, needsConversion> *res =
|
||||
new RangeQuery<MatchFuncArgType, DataFuncArgType, needsConversion>();
|
||||
res->setUpper(this->d_upper);
|
||||
@@ -94,7 +95,7 @@ class RDKIT_QUERY_EXPORT RangeQuery
|
||||
return res;
|
||||
}
|
||||
|
||||
std::string getFullDescription() const {
|
||||
std::string getFullDescription() const override {
|
||||
std::ostringstream res;
|
||||
res << this->getDescription();
|
||||
if (this->getNegation()) res << " ! ";
|
||||
|
||||
@@ -37,13 +37,14 @@ class RDKIT_QUERY_EXPORT SetQuery
|
||||
//! clears our \c set
|
||||
void clear() { this->d_set.clear(); }
|
||||
|
||||
bool Match(const DataFuncArgType what) const {
|
||||
bool Match(const DataFuncArgType what) const override {
|
||||
MatchFuncArgType mfArg =
|
||||
this->TypeConvert(what, Int2Type<needsConversion>());
|
||||
return (this->d_set.find(mfArg) != this->d_set.end()) ^ this->getNegation();
|
||||
}
|
||||
|
||||
Query<MatchFuncArgType, DataFuncArgType, needsConversion> *copy() const {
|
||||
Query<MatchFuncArgType, DataFuncArgType, needsConversion> *copy()
|
||||
const override {
|
||||
SetQuery<MatchFuncArgType, DataFuncArgType, needsConversion> *res =
|
||||
new SetQuery<MatchFuncArgType, DataFuncArgType, needsConversion>();
|
||||
res->setDataFunc(this->d_dataFunc);
|
||||
@@ -63,7 +64,7 @@ class RDKIT_QUERY_EXPORT SetQuery
|
||||
typename CONTAINER_TYPE::const_iterator endSet() const { return d_set.end(); }
|
||||
unsigned int size() const { return rdcast<unsigned int>(d_set.size()); }
|
||||
|
||||
std::string getFullDescription() const {
|
||||
std::string getFullDescription() const override {
|
||||
std::ostringstream res;
|
||||
res << this->getDescription() << " val";
|
||||
if (this->getNegation())
|
||||
|
||||
@@ -24,7 +24,7 @@ class RDKIT_QUERY_EXPORT XOrQuery
|
||||
typedef Query<MatchFuncArgType, DataFuncArgType, needsConversion> BASE;
|
||||
XOrQuery() { this->df_negate = false; }
|
||||
|
||||
bool Match(const DataFuncArgType what) const {
|
||||
bool Match(const DataFuncArgType what) const override {
|
||||
bool res = false;
|
||||
typename BASE::CHILD_VECT_CI it1;
|
||||
for (it1 = this->beginChildren(); it1 != this->endChildren(); ++it1) {
|
||||
@@ -42,7 +42,8 @@ class RDKIT_QUERY_EXPORT XOrQuery
|
||||
return res;
|
||||
}
|
||||
|
||||
Query<MatchFuncArgType, DataFuncArgType, needsConversion> *copy() const {
|
||||
Query<MatchFuncArgType, DataFuncArgType, needsConversion> *copy()
|
||||
const override {
|
||||
XOrQuery<MatchFuncArgType, DataFuncArgType, needsConversion> *res =
|
||||
new XOrQuery<MatchFuncArgType, DataFuncArgType, needsConversion>();
|
||||
|
||||
|
||||
@@ -232,7 +232,7 @@ class streambuf : public std::basic_streambuf<char> {
|
||||
}
|
||||
|
||||
/// Mundane destructor freeing the allocated resources
|
||||
virtual ~streambuf() {
|
||||
~streambuf() override {
|
||||
if (write_buffer) delete[] write_buffer;
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ class streambuf : public std::basic_streambuf<char> {
|
||||
/** It is essential to override this virtual function for the stream
|
||||
member function readsome to work correctly (c.f. 27.6.1.3, alinea 30)
|
||||
*/
|
||||
virtual std::streamsize showmanyc() {
|
||||
std::streamsize showmanyc() override {
|
||||
int_type const failure = traits_type::eof();
|
||||
int_type status = underflow();
|
||||
if (status == failure) return -1;
|
||||
@@ -248,7 +248,7 @@ class streambuf : public std::basic_streambuf<char> {
|
||||
}
|
||||
|
||||
/// C.f. C++ standard section 27.5.2.4.3
|
||||
virtual int_type underflow() {
|
||||
int_type underflow() override {
|
||||
int_type const failure = traits_type::eof();
|
||||
if (py_read == bp::object()) {
|
||||
throw std::invalid_argument(
|
||||
@@ -273,7 +273,7 @@ class streambuf : public std::basic_streambuf<char> {
|
||||
}
|
||||
|
||||
/// C.f. C++ standard section 27.5.2.4.5
|
||||
virtual int_type overflow(int_type c = traits_type_eof()) {
|
||||
int_type overflow(int_type c = traits_type_eof()) override {
|
||||
if (py_write == bp::object()) {
|
||||
throw std::invalid_argument(
|
||||
"That Python file object has no 'write' attribute");
|
||||
@@ -329,7 +329,7 @@ class streambuf : public std::basic_streambuf<char> {
|
||||
read buffer, set the Python file object seek position to the
|
||||
seek position in that read buffer.
|
||||
*/
|
||||
virtual int sync() {
|
||||
int sync() override {
|
||||
int result = 0;
|
||||
farthest_pptr = std::max(farthest_pptr, pptr());
|
||||
if (farthest_pptr && farthest_pptr > pbase()) {
|
||||
@@ -350,9 +350,9 @@ class streambuf : public std::basic_streambuf<char> {
|
||||
is avoided as much as possible (e.g. parsers which may do a lot of
|
||||
backtracking)
|
||||
*/
|
||||
virtual pos_type seekoff(off_type off, std::ios_base::seekdir way,
|
||||
std::ios_base::openmode which = std::ios_base::in |
|
||||
std::ios_base::out) {
|
||||
pos_type seekoff(off_type off, std::ios_base::seekdir way,
|
||||
std::ios_base::openmode which =
|
||||
std::ios_base::in | std::ios_base::out) override {
|
||||
/* In practice, "which" is either std::ios_base::in or out
|
||||
since we end up here because either seekp or seekg was called
|
||||
on the stream using this buffer. That simplifies the code
|
||||
@@ -408,9 +408,9 @@ class streambuf : public std::basic_streambuf<char> {
|
||||
}
|
||||
|
||||
/// C.f. C++ standard section 27.5.2.4.2
|
||||
virtual pos_type seekpos(pos_type sp,
|
||||
std::ios_base::openmode which = std::ios_base::in |
|
||||
std::ios_base::out) {
|
||||
pos_type seekpos(pos_type sp,
|
||||
std::ios_base::openmode which =
|
||||
std::ios_base::in | std::ios_base::out) override {
|
||||
return streambuf::seekoff(sp, std::ios_base::beg, which);
|
||||
}
|
||||
|
||||
@@ -492,7 +492,7 @@ class streambuf : public std::basic_streambuf<char> {
|
||||
exceptions(std::ios_base::badbit);
|
||||
}
|
||||
|
||||
~istream() {
|
||||
~istream() override {
|
||||
// do nothing.
|
||||
// This used to do:
|
||||
// if (this->good()) this->sync();
|
||||
@@ -508,7 +508,7 @@ class streambuf : public std::basic_streambuf<char> {
|
||||
exceptions(std::ios_base::badbit);
|
||||
}
|
||||
|
||||
~ostream() {
|
||||
~ostream() override {
|
||||
if (this->good()) this->flush();
|
||||
}
|
||||
};
|
||||
@@ -528,7 +528,7 @@ struct ostream : private streambuf_capsule, streambuf::ostream {
|
||||
: streambuf_capsule(python_file_obj, buffer_size),
|
||||
streambuf::ostream(python_streambuf) {}
|
||||
|
||||
~ostream() noexcept {
|
||||
~ostream() noexcept override {
|
||||
if (this->good()) {
|
||||
this->flush();
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class RDKIT_RDGENERAL_EXPORT BadFileException : public std::runtime_error {
|
||||
: std::runtime_error("BadFileException"), _msg(std::move(msg)) {}
|
||||
//! get the error message
|
||||
const char *what() const noexcept override { return _msg.c_str(); }
|
||||
~BadFileException() noexcept {}
|
||||
~BadFileException() noexcept override {}
|
||||
|
||||
private:
|
||||
std::string _msg;
|
||||
|
||||
@@ -27,7 +27,7 @@ class RDKIT_RDGENERAL_EXPORT IndexErrorException : public std::runtime_error {
|
||||
|
||||
const char* what() const noexcept override { return _msg.c_str(); }
|
||||
|
||||
~IndexErrorException() noexcept {}
|
||||
~IndexErrorException() noexcept override {}
|
||||
|
||||
private:
|
||||
int _idx;
|
||||
@@ -44,7 +44,7 @@ class RDKIT_RDGENERAL_EXPORT ValueErrorException : public std::runtime_error {
|
||||
ValueErrorException(const char* msg)
|
||||
: std::runtime_error("ValueErrorException"), _value(msg) {}
|
||||
const char* what() const noexcept override { return _value.c_str(); }
|
||||
~ValueErrorException() noexcept {}
|
||||
~ValueErrorException() noexcept override {}
|
||||
|
||||
private:
|
||||
std::string _value;
|
||||
@@ -63,7 +63,7 @@ class RDKIT_RDGENERAL_EXPORT KeyErrorException : public std::runtime_error {
|
||||
|
||||
const char* what() const noexcept override { return _msg.c_str(); }
|
||||
|
||||
~KeyErrorException() noexcept {}
|
||||
~KeyErrorException() noexcept override {}
|
||||
|
||||
private:
|
||||
std::string _key;
|
||||
|
||||
@@ -26,7 +26,7 @@ class RDKIT_RDGENERAL_EXPORT FileParseException : public std::runtime_error {
|
||||
: std::runtime_error("FileParseException"), _msg(msg) {}
|
||||
//! get the error message
|
||||
const char *what() const noexcept override { return _msg.c_str(); }
|
||||
~FileParseException() noexcept {}
|
||||
~FileParseException() noexcept override {}
|
||||
|
||||
private:
|
||||
std::string _msg;
|
||||
|
||||
@@ -66,7 +66,7 @@ class RDKIT_RDGENERAL_EXPORT Invariant : public std::runtime_error {
|
||||
prefix_d(prefix),
|
||||
file_dp(file),
|
||||
line_d(line) {}
|
||||
~Invariant() noexcept {}
|
||||
~Invariant() noexcept override {}
|
||||
|
||||
const char* what() const noexcept override { return mess_d.c_str(); }
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user