diff --git a/Code/Catalogs/Catalog.h b/Code/Catalogs/Catalog.h index 7c14ab2f5..989c87802 100644 --- a/Code/Catalogs/Catalog.h +++ b/Code/Catalogs/Catalog.h @@ -175,7 +175,7 @@ class HierarchCatalog : public Catalog { } //------------------------------------ - ~HierarchCatalog() { destroy(); } + ~HierarchCatalog() override { destroy(); } //------------------------------------ //! serializes this object to a stream @@ -225,7 +225,7 @@ class HierarchCatalog : public Catalog { //------------------------------------ //! 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 { } //------------------------------------ - unsigned int getNumEntries() const { + unsigned int getNumEntries() const override { return static_cast(boost::num_vertices(d_graph)); } @@ -306,7 +306,7 @@ class HierarchCatalog : public Catalog { 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 { //------------------------------------ //! 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(boost::vertex(idx, d_graph)); typename boost::property_map::const_type diff --git a/Code/ChemicalFeatures/FreeChemicalFeature.h b/Code/ChemicalFeatures/FreeChemicalFeature.h index 5f7143587..307bee5fd 100644 --- a/Code/ChemicalFeatures/FreeChemicalFeature.h +++ b/Code/ChemicalFeatures/FreeChemicalFeature.h @@ -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; } diff --git a/Code/DataStructs/DatastructsException.h b/Code/DataStructs/DatastructsException.h index 3bc819c56..b4e881b69 100644 --- a/Code/DataStructs/DatastructsException.h +++ b/Code/DataStructs/DatastructsException.h @@ -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; diff --git a/Code/DataStructs/DatastructsStreamOps.h b/Code/DataStructs/DatastructsStreamOps.h index 1b854bf58..b73969272 100644 --- a/Code/DataStructs/DatastructsStreamOps.h +++ b/Code/DataStructs/DatastructsStreamOps.h @@ -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(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(value).toString(); @@ -63,7 +63,7 @@ class DataStructsExplicitBitVecPropHandler : public CustomPropHandler { } } - CustomPropHandler *clone() const { + CustomPropHandler *clone() const override { return new DataStructsExplicitBitVecPropHandler; } }; diff --git a/Code/DataStructs/ExplicitBitVect.h b/Code/DataStructs/ExplicitBitVect.h index fbe003d6a..dca625832 100644 --- a/Code/DataStructs/ExplicitBitVect.h +++ b/Code/DataStructs/ExplicitBitVect.h @@ -48,13 +48,13 @@ class RDKIT_DATASTRUCTS_EXPORT ExplicitBitVect : public BitVect { d_size(static_cast(bits->size())), d_numOnBits(static_cast(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 diff --git a/Code/DataStructs/SparseBitVect.h b/Code/DataStructs/SparseBitVect.h index f2f01ac59..33a2e94c1 100644 --- a/Code/DataStructs/SparseBitVect.h +++ b/Code/DataStructs/SparseBitVect.h @@ -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(dp_bits->size()); } - unsigned int getNumOffBits() const { + unsigned int getNumOffBits() const override { return d_size - static_cast(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 diff --git a/Code/DistGeom/ChiralViolationContrib.h b/Code/DistGeom/ChiralViolationContrib.h index e163d418a..e643b86a2 100644 --- a/Code/DistGeom/ChiralViolationContrib.h +++ b/Code/DistGeom/ChiralViolationContrib.h @@ -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); } diff --git a/Code/DistGeom/DistViolationContrib.h b/Code/DistGeom/DistViolationContrib.h index fd2fc5307..e9e83adc0 100644 --- a/Code/DistGeom/DistViolationContrib.h +++ b/Code/DistGeom/DistViolationContrib.h @@ -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); } diff --git a/Code/DistGeom/FourthDimContrib.h b/Code/DistGeom/FourthDimContrib.h index 31e620537..a0ece1ae8 100644 --- a/Code/DistGeom/FourthDimContrib.h +++ b/Code/DistGeom/FourthDimContrib.h @@ -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}; diff --git a/Code/ForceField/MMFF/AngleBend.h b/Code/ForceField/MMFF/AngleBend.h index 8f66cf1cb..3bf42bd37 100644 --- a/Code/ForceField/MMFF/AngleBend.h +++ b/Code/ForceField/MMFF/AngleBend.h @@ -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; diff --git a/Code/ForceField/MMFF/AngleConstraint.h b/Code/ForceField/MMFF/AngleConstraint.h index 1cbccd846..8e1fde2da 100644 --- a/Code/ForceField/MMFF/AngleConstraint.h +++ b/Code/ForceField/MMFF/AngleConstraint.h @@ -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); } diff --git a/Code/ForceField/MMFF/BondStretch.h b/Code/ForceField/MMFF/BondStretch.h index 818c351a0..53f8c4d71 100644 --- a/Code/ForceField/MMFF/BondStretch.h +++ b/Code/ForceField/MMFF/BondStretch.h @@ -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); } diff --git a/Code/ForceField/MMFF/DistanceConstraint.h b/Code/ForceField/MMFF/DistanceConstraint.h index c2c431c57..565b8032b 100644 --- a/Code/ForceField/MMFF/DistanceConstraint.h +++ b/Code/ForceField/MMFF/DistanceConstraint.h @@ -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); } diff --git a/Code/ForceField/MMFF/Nonbonded.h b/Code/ForceField/MMFF/Nonbonded.h index 873287918..244b35cd7 100644 --- a/Code/ForceField/MMFF/Nonbonded.h +++ b/Code/ForceField/MMFF/Nonbonded.h @@ -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}; diff --git a/Code/ForceField/MMFF/OopBend.h b/Code/ForceField/MMFF/OopBend.h index a9606af44..bc7a70a60 100644 --- a/Code/ForceField/MMFF/OopBend.h +++ b/Code/ForceField/MMFF/OopBend.h @@ -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}; diff --git a/Code/ForceField/MMFF/PositionConstraint.h b/Code/ForceField/MMFF/PositionConstraint.h index d7618e6a8..01414ecf2 100644 --- a/Code/ForceField/MMFF/PositionConstraint.h +++ b/Code/ForceField/MMFF/PositionConstraint.h @@ -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); } diff --git a/Code/ForceField/MMFF/StretchBend.h b/Code/ForceField/MMFF/StretchBend.h index ef4605967..711155fc0 100644 --- a/Code/ForceField/MMFF/StretchBend.h +++ b/Code/ForceField/MMFF/StretchBend.h @@ -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); } diff --git a/Code/ForceField/MMFF/TorsionAngle.h b/Code/ForceField/MMFF/TorsionAngle.h index 5cc834a72..c0b6cbe01 100644 --- a/Code/ForceField/MMFF/TorsionAngle.h +++ b/Code/ForceField/MMFF/TorsionAngle.h @@ -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); } diff --git a/Code/ForceField/MMFF/TorsionConstraint.h b/Code/ForceField/MMFF/TorsionConstraint.h index 98625ac25..a8caadc89 100644 --- a/Code/ForceField/MMFF/TorsionConstraint.h +++ b/Code/ForceField/MMFF/TorsionConstraint.h @@ -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); } diff --git a/Code/ForceField/UFF/AngleBend.h b/Code/ForceField/UFF/AngleBend.h index fbebd0a3b..94cd3234c 100644 --- a/Code/ForceField/UFF/AngleBend.h +++ b/Code/ForceField/UFF/AngleBend.h @@ -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}; diff --git a/Code/ForceField/UFF/AngleConstraint.h b/Code/ForceField/UFF/AngleConstraint.h index c419e9152..622d46844 100644 --- a/Code/ForceField/UFF/AngleConstraint.h +++ b/Code/ForceField/UFF/AngleConstraint.h @@ -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); } diff --git a/Code/ForceField/UFF/BondStretch.h b/Code/ForceField/UFF/BondStretch.h index 316584ba7..66a1535cd 100644 --- a/Code/ForceField/UFF/BondStretch.h +++ b/Code/ForceField/UFF/BondStretch.h @@ -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); } diff --git a/Code/ForceField/UFF/DistanceConstraint.h b/Code/ForceField/UFF/DistanceConstraint.h index 087430c7c..74392bd94 100644 --- a/Code/ForceField/UFF/DistanceConstraint.h +++ b/Code/ForceField/UFF/DistanceConstraint.h @@ -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); } diff --git a/Code/ForceField/UFF/Inversion.h b/Code/ForceField/UFF/Inversion.h index b15d1b40e..42c6f92ea 100644 --- a/Code/ForceField/UFF/Inversion.h +++ b/Code/ForceField/UFF/Inversion.h @@ -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}; diff --git a/Code/ForceField/UFF/Nonbonded.h b/Code/ForceField/UFF/Nonbonded.h index edf6cb3a3..c5147aa19 100644 --- a/Code/ForceField/UFF/Nonbonded.h +++ b/Code/ForceField/UFF/Nonbonded.h @@ -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}; diff --git a/Code/ForceField/UFF/PositionConstraint.h b/Code/ForceField/UFF/PositionConstraint.h index f7619586e..a0c5e5ae0 100644 --- a/Code/ForceField/UFF/PositionConstraint.h +++ b/Code/ForceField/UFF/PositionConstraint.h @@ -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); } diff --git a/Code/ForceField/UFF/TorsionAngle.h b/Code/ForceField/UFF/TorsionAngle.h index 03a6ce63a..35f70f2d4 100644 --- a/Code/ForceField/UFF/TorsionAngle.h +++ b/Code/ForceField/UFF/TorsionAngle.h @@ -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(count); } - virtual TorsionAngleContrib *copy() const { + TorsionAngleContrib *copy() const override { return new TorsionAngleContrib(*this); } diff --git a/Code/ForceField/UFF/TorsionConstraint.h b/Code/ForceField/UFF/TorsionConstraint.h index aa36c70ae..618c9fff1 100644 --- a/Code/ForceField/UFF/TorsionConstraint.h +++ b/Code/ForceField/UFF/TorsionConstraint.h @@ -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); } diff --git a/Code/Geometry/Grid3D.h b/Code/Geometry/Grid3D.h index fa2738325..f14150e0d 100644 --- a/Code/Geometry/Grid3D.h +++ b/Code/Geometry/Grid3D.h @@ -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; diff --git a/Code/Geometry/UniformGrid3D.h b/Code/Geometry/UniformGrid3D.h index 9c66f1d64..6624f0b52 100644 --- a/Code/Geometry/UniformGrid3D.h +++ b/Code/Geometry/UniformGrid3D.h @@ -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; } diff --git a/Code/Geometry/point.h b/Code/Geometry/point.h index 717397670..c356da00e 100644 --- a/Code/Geometry/point.h +++ b/Code/Geometry/point.h @@ -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 @@ -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; diff --git a/Code/GraphMol/ChemReactions/Enumerate/CartesianProduct.h b/Code/GraphMol/ChemReactions/Enumerate/CartesianProduct.h index e448e4c64..246396607 100644 --- a/Code/GraphMol/ChemReactions/Enumerate/CartesianProduct.h +++ b/Code/GraphMol/ChemReactions/Enumerate/CartesianProduct.h @@ -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); } diff --git a/Code/GraphMol/ChemReactions/Enumerate/Enumerate.h b/Code/GraphMol/ChemReactions/Enumerate/Enumerate.h index 087dbd2ed..ed2140bc4 100644 --- a/Code/GraphMol/ChemReactions/Enumerate/Enumerate.h +++ b/Code/GraphMol/ChemReactions/Enumerate/Enumerate.h @@ -131,10 +131,10 @@ class RDKIT_CHEMREACTIONS_EXPORT EnumerateLibrary const EnumerationTypes::BBS &getReagents() const { return m_bbs; } //! Get the next product set - std::vector next(); + std::vector 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 diff --git a/Code/GraphMol/ChemReactions/Enumerate/EnumerationStrategyBase.h b/Code/GraphMol/ChemReactions/Enumerate/EnumerationStrategyBase.h index 60a01f446..7bdba9575 100644 --- a/Code/GraphMol/ChemReactions/Enumerate/EnumerationStrategyBase.h +++ b/Code/GraphMol/ChemReactions/Enumerate/EnumerationStrategyBase.h @@ -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; diff --git a/Code/GraphMol/ChemReactions/Enumerate/EvenSamplePairs.h b/Code/GraphMol/ChemReactions/Enumerate/EvenSamplePairs.h index a85ae5ec8..0db4dcff5 100644 --- a/Code/GraphMol/ChemReactions/Enumerate/EvenSamplePairs.h +++ b/Code/GraphMol/ChemReactions/Enumerate/EvenSamplePairs.h @@ -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); } diff --git a/Code/GraphMol/ChemReactions/Enumerate/RandomSample.h b/Code/GraphMol/ChemReactions/Enumerate/RandomSample.h index c3d87c8eb..f06c9ae96 100644 --- a/Code/GraphMol/ChemReactions/Enumerate/RandomSample.h +++ b/Code/GraphMol/ChemReactions/Enumerate/RandomSample.h @@ -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); } diff --git a/Code/GraphMol/ChemReactions/Enumerate/RandomSampleAllBBs.h b/Code/GraphMol/ChemReactions/Enumerate/RandomSampleAllBBs.h index 418246f19..e6965127a 100644 --- a/Code/GraphMol/ChemReactions/Enumerate/RandomSampleAllBBs.h +++ b/Code/GraphMol/ChemReactions/Enumerate/RandomSampleAllBBs.h @@ -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); } diff --git a/Code/GraphMol/ChemReactions/Reaction.h b/Code/GraphMol/ChemReactions/Reaction.h index 593e7422f..4beb31491 100644 --- a/Code/GraphMol/ChemReactions/Reaction.h +++ b/Code/GraphMol/ChemReactions/Reaction.h @@ -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; diff --git a/Code/GraphMol/ChemReactions/ReactionParser.h b/Code/GraphMol/ChemReactions/ReactionParser.h index ea5f2cd14..3307ff7bd 100644 --- a/Code/GraphMol/ChemReactions/ReactionParser.h +++ b/Code/GraphMol/ChemReactions/ReactionParser.h @@ -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; diff --git a/Code/GraphMol/ChemReactions/ReactionPickler.h b/Code/GraphMol/ChemReactions/ReactionPickler.h index fe9067654..9f4af6e53 100644 --- a/Code/GraphMol/ChemReactions/ReactionPickler.h +++ b/Code/GraphMol/ChemReactions/ReactionPickler.h @@ -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; diff --git a/Code/GraphMol/ChemReactions/SanitizeRxn.h b/Code/GraphMol/ChemReactions/SanitizeRxn.h index 349b2733e..f58b42d66 100644 --- a/Code/GraphMol/ChemReactions/SanitizeRxn.h +++ b/Code/GraphMol/ChemReactions/SanitizeRxn.h @@ -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; diff --git a/Code/GraphMol/ChemReactions/Wrap/Enumerate.cpp b/Code/GraphMol/ChemReactions/Wrap/Enumerate.cpp index 9787a0920..7b1925485 100644 --- a/Code/GraphMol/ChemReactions/Wrap/Enumerate.cpp +++ b/Code/GraphMol/ChemReactions/Wrap/Enumerate.cpp @@ -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() diff --git a/Code/GraphMol/Conformer.h b/Code/GraphMol/Conformer.h index eefb5c554..536620ac5 100644 --- a/Code/GraphMol/Conformer.h +++ b/Code/GraphMol/Conformer.h @@ -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; diff --git a/Code/GraphMol/Depictor/RDDepictor.h b/Code/GraphMol/Depictor/RDDepictor.h index 5e6c86dcf..886c98cc9 100644 --- a/Code/GraphMol/Depictor/RDDepictor.h +++ b/Code/GraphMol/Depictor/RDDepictor.h @@ -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; diff --git a/Code/GraphMol/FileParsers/MolSupplier.h b/Code/GraphMol/FileParsers/MolSupplier.h index 6a09d34a6..de9beb232 100644 --- a/Code/GraphMol/FileParsers/MolSupplier.h +++ b/Code/GraphMol/FileParsers/MolSupplier.h @@ -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 &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(); diff --git a/Code/GraphMol/FileParsers/MolWriters.h b/Code/GraphMol/FileParsers/MolWriters.h index f80475b47..e415fd00d 100644 --- a/Code/GraphMol/FileParsers/MolWriters.h +++ b/Code/GraphMol/FileParsers/MolWriters.h @@ -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; diff --git a/Code/GraphMol/FileParsers/MultithreadedMolSupplier.h b/Code/GraphMol/FileParsers/MultithreadedMolSupplier.h index 8ca3fe363..8123285ec 100644 --- a/Code/GraphMol/FileParsers/MultithreadedMolSupplier.h +++ b/Code/GraphMol/FileParsers/MultithreadedMolSupplier.h @@ -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, diff --git a/Code/GraphMol/FileParsers/MultithreadedSDMolSupplier.h b/Code/GraphMol/FileParsers/MultithreadedSDMolSupplier.h index cb7a82695..3f2bc3631 100644 --- a/Code/GraphMol/FileParsers/MultithreadedSDMolSupplier.h +++ b/Code/GraphMol/FileParsers/MultithreadedSDMolSupplier.h @@ -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, diff --git a/Code/GraphMol/FileParsers/MultithreadedSmilesMolSupplier.h b/Code/GraphMol/FileParsers/MultithreadedSmilesMolSupplier.h index 7022679ec..e29bc8df0 100644 --- a/Code/GraphMol/FileParsers/MultithreadedSmilesMolSupplier.h +++ b/Code/GraphMol/FileParsers/MultithreadedSmilesMolSupplier.h @@ -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, diff --git a/Code/GraphMol/FileParsers/testMultithreadedMolSupplier.cpp b/Code/GraphMol/FileParsers/testMultithreadedMolSupplier.cpp index e2563179f..8f983ba8a 100644 --- a/Code/GraphMol/FileParsers/testMultithreadedMolSupplier.cpp +++ b/Code/GraphMol/FileParsers/testMultithreadedMolSupplier.cpp @@ -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 l{cout_mutex}; std::cout << rdbuf(); } diff --git a/Code/GraphMol/FilterCatalog/FilterCatalog.h b/Code/GraphMol/FilterCatalog/FilterCatalog.h index b34f08ab3..a74c99cbd 100644 --- a/Code/GraphMol/FilterCatalog/FilterCatalog.h +++ b/Code/GraphMol/FilterCatalog/FilterCatalog.h @@ -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 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(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 diff --git a/Code/GraphMol/FilterCatalog/FilterCatalogEntry.h b/Code/GraphMol/FilterCatalog/FilterCatalogEntry.h index ef9304093..c16f45403 100644 --- a/Code/GraphMol/FilterCatalog/FilterCatalogEntry.h +++ b/Code/GraphMol/FilterCatalog/FilterCatalogEntry.h @@ -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 diff --git a/Code/GraphMol/FilterCatalog/FilterMatchers.h b/Code/GraphMol/FilterCatalog/FilterMatchers.h index eba8e981f..58c07d7ec 100644 --- a/Code/GraphMol/FilterCatalog/FilterMatchers.h +++ b/Code/GraphMol/FilterCatalog/FilterMatchers.h @@ -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 &matchVect) const { + bool getMatches(const ROMol &mol, + std::vector &matchVect) const override { PRECONDITION(isValid(), "FilterMatchOps::And is not valid, null arg1 or arg2"); std::vector matches; @@ -98,7 +99,7 @@ class RDKIT_FILTERCATALOG_EXPORT And : public FilterMatcherBase { return false; } - boost::shared_ptr copy() const { + boost::shared_ptr copy() const override { return boost::shared_ptr(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 &matchVect) const { + bool getMatches(const ROMol &mol, + std::vector &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 copy() const { + boost::shared_ptr copy() const override { return boost::shared_ptr(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 &) const { + bool getMatches(const ROMol &mol, std::vector &) 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 copy() const { + boost::shared_ptr copy() const override { return boost::shared_ptr(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 &matchVect) const; - virtual bool hasMatch(const ROMol &mol) const; - virtual boost::shared_ptr copy() const { + bool getMatches(const ROMol &mol, + std::vector &matchVect) const override; + bool hasMatch(const ROMol &mol) const override; + boost::shared_ptr copy() const override { return boost::shared_ptr(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 &) const { + bool getMatches(const ROMol &mol, std::vector &) 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 copy() const { + boost::shared_ptr copy() const override { return boost::shared_ptr(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 &matches) const; + bool getMatches(const ROMol &mol, + std::vector &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 temp; return getMatches(mol, temp); } //! copys the FilterHierarchyMatcher into a FilterMatcherBase - virtual boost::shared_ptr copy() const { + boost::shared_ptr copy() const override { return boost::shared_ptr( new FilterHierarchyMatcher(*this)); } diff --git a/Code/GraphMol/Fingerprints/AtomPairGenerator.h b/Code/GraphMol/Fingerprints/AtomPairGenerator.h index dc039c11a..33762668b 100644 --- a/Code/GraphMol/Fingerprints/AtomPairGenerator.h +++ b/Code/GraphMol/Fingerprints/AtomPairGenerator.h @@ -36,10 +36,11 @@ class RDKIT_FINGERPRINTS_EXPORT AtomPairAtomInvGenerator AtomPairAtomInvGenerator(bool includeChirality = false, bool topologicalTorsionCorrection = false); - std::vector *getAtomInvariants(const ROMol &mol) const; + std::vector *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 *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 *atomInvariants, const std::vector *bondInvariants, - const bool hashResults = false) const; + const bool hashResults = false) const override; - std::string infoString() const; + std::string infoString() const override; }; /*! diff --git a/Code/GraphMol/Fingerprints/FingerprintGenerator.h b/Code/GraphMol/Fingerprints/FingerprintGenerator.h index 8ea396c43..3706d86ea 100644 --- a/Code/GraphMol/Fingerprints/FingerprintGenerator.h +++ b/Code/GraphMol/Fingerprints/FingerprintGenerator.h @@ -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; diff --git a/Code/GraphMol/Fingerprints/MorganGenerator.h b/Code/GraphMol/Fingerprints/MorganGenerator.h index 82d3ee0e2..cd2a87211 100644 --- a/Code/GraphMol/Fingerprints/MorganGenerator.h +++ b/Code/GraphMol/Fingerprints/MorganGenerator.h @@ -37,10 +37,11 @@ class RDKIT_FINGERPRINTS_EXPORT MorganAtomInvGenerator */ MorganAtomInvGenerator(const bool includeRingMembership = true); - std::vector *getAtomInvariants(const ROMol &mol) const; + std::vector *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 *patterns = nullptr); - std::vector *getAtomInvariants(const ROMol &mol) const; + std::vector *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 *getBondInvariants(const ROMol &mol) const; + std::vector *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 *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 *atomInvariants, const std::vector *bondInvariants, - const bool hashResults = false) const; + const bool hashResults = false) const override; - std::string infoString() const; + std::string infoString() const override; }; /** diff --git a/Code/GraphMol/Fingerprints/RDKitFPGenerator.h b/Code/GraphMol/Fingerprints/RDKitFPGenerator.h index 337872e3a..a7ce27f0a 100644 --- a/Code/GraphMol/Fingerprints/RDKitFPGenerator.h +++ b/Code/GraphMol/Fingerprints/RDKitFPGenerator.h @@ -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 *getAtomInvariants(const ROMol &mol) const; + std::vector *getAtomInvariants( + const ROMol &mol) const override; - std::string infoString() const; - RDKitFPAtomInvGenerator *clone() const; + std::string infoString() const override; + RDKitFPAtomInvGenerator *clone() const override; }; template @@ -79,7 +80,7 @@ class RDKIT_FINGERPRINTS_EXPORT RDKitFPAtomEnv const std::vector *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 *atomInvariants, const std::vector *bondInvariants, - bool hashResults = false) const; + bool hashResults = false) const override; - std::string infoString() const; + std::string infoString() const override; }; /** diff --git a/Code/GraphMol/Fingerprints/TopologicalTorsionGenerator.h b/Code/GraphMol/Fingerprints/TopologicalTorsionGenerator.h index db38812a3..662b37cc2 100644 --- a/Code/GraphMol/Fingerprints/TopologicalTorsionGenerator.h +++ b/Code/GraphMol/Fingerprints/TopologicalTorsionGenerator.h @@ -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 *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 *atomInvariants, const std::vector *bondInvariants, - const bool hashResults = false) const; + const bool hashResults = false) const override; - std::string infoString() const; + std::string infoString() const override; }; /** diff --git a/Code/GraphMol/ForceFieldHelpers/CrystalFF/TorsionAngleM6.h b/Code/GraphMol/ForceFieldHelpers/CrystalFF/TorsionAngleM6.h index 3f1d46a74..867e554bd 100644 --- a/Code/GraphMol/ForceFieldHelpers/CrystalFF/TorsionAngleM6.h +++ b/Code/GraphMol/ForceFieldHelpers/CrystalFF/TorsionAngleM6.h @@ -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 V, std::vector 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); } diff --git a/Code/GraphMol/FragCatalog/FragCatParams.h b/Code/GraphMol/FragCatalog/FragCatParams.h index 5dbafa7cf..c23cb0dad 100644 --- a/Code/GraphMol/FragCatalog/FragCatParams.h +++ b/Code/GraphMol/FragCatalog/FragCatParams.h @@ -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; diff --git a/Code/GraphMol/FragCatalog/FragCatalogEntry.h b/Code/GraphMol/FragCatalog/FragCatalogEntry.h index 32ac2a34d..415b3a96f 100644 --- a/Code/GraphMol/FragCatalog/FragCatalogEntry.h +++ b/Code/GraphMol/FragCatalog/FragCatalogEntry.h @@ -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}; diff --git a/Code/GraphMol/MolAlign/AlignMolecules.h b/Code/GraphMol/MolAlign/AlignMolecules.h index 7256aa4ca..555d63d5d 100644 --- a/Code/GraphMol/MolAlign/AlignMolecules.h +++ b/Code/GraphMol/MolAlign/AlignMolecules.h @@ -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; diff --git a/Code/GraphMol/MolCatalog/MolCatalogEntry.h b/Code/GraphMol/MolCatalog/MolCatalogEntry.h index 2c83c9567..183738007 100644 --- a/Code/GraphMol/MolCatalog/MolCatalogEntry.h +++ b/Code/GraphMol/MolCatalog/MolCatalogEntry.h @@ -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}; diff --git a/Code/GraphMol/MolCatalog/MolCatalogParams.h b/Code/GraphMol/MolCatalog/MolCatalogParams.h index f4db677f9..2fe3f7965 100644 --- a/Code/GraphMol/MolCatalog/MolCatalogParams.h +++ b/Code/GraphMol/MolCatalog/MolCatalogParams.h @@ -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 diff --git a/Code/GraphMol/MolChemicalFeatures/FeatureParser.h b/Code/GraphMol/MolChemicalFeatures/FeatureParser.h index 45c958101..6743cc5e6 100644 --- a/Code/GraphMol/MolChemicalFeatures/FeatureParser.h +++ b/Code/GraphMol/MolChemicalFeatures/FeatureParser.h @@ -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; diff --git a/Code/GraphMol/MolChemicalFeatures/MolChemicalFeature.h b/Code/GraphMol/MolChemicalFeatures/MolChemicalFeature.h index c649d2ea4..48620441d 100644 --- a/Code/GraphMol/MolChemicalFeatures/MolChemicalFeature.h +++ b/Code/GraphMol/MolChemicalFeatures/MolChemicalFeature.h @@ -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(); } diff --git a/Code/GraphMol/MolDraw2D/DrawTextFT.h b/Code/GraphMol/MolDraw2D/DrawTextFT.h index 55e486a80..e27614097 100644 --- a/Code/GraphMol/MolDraw2D/DrawTextFT.h +++ b/Code/GraphMol/MolDraw2D/DrawTextFT.h @@ -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; diff --git a/Code/GraphMol/MolDraw2D/DrawTextFTSVG.h b/Code/GraphMol/MolDraw2D/DrawTextFTSVG.h index d1f0faed2..8520a1cd2 100644 --- a/Code/GraphMol/MolDraw2D/DrawTextFTSVG.h +++ b/Code/GraphMol/MolDraw2D/DrawTextFTSVG.h @@ -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_; diff --git a/Code/GraphMol/MolDraw2D/MolDraw2DSVG.h b/Code/GraphMol/MolDraw2D/MolDraw2DSVG.h index ac85e9664..62ab383f8 100644 --- a/Code/GraphMol/MolDraw2D/MolDraw2DSVG.h +++ b/Code/GraphMol/MolDraw2D/MolDraw2DSVG.h @@ -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; diff --git a/Code/GraphMol/MolPickler.h b/Code/GraphMol/MolPickler.h index b869c2da6..6568276c8 100644 --- a/Code/GraphMol/MolPickler.h +++ b/Code/GraphMol/MolPickler.h @@ -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; diff --git a/Code/GraphMol/MolStandardize/Validate.h b/Code/GraphMol/MolStandardize/Validate.h index 7efc8227d..4143d3b1d 100644 --- a/Code/GraphMol/MolStandardize/Validate.h +++ b/Code/GraphMol/MolStandardize/Validate.h @@ -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 &errors) const override; //! makes a copy of NoAtomValidation object and returns a MolVSValidations //! pointer to it - virtual boost::shared_ptr copy() const override { + boost::shared_ptr copy() const override { return boost::make_shared(*this); } }; @@ -108,7 +108,7 @@ class RDKIT_MOLSTANDARDIZE_EXPORT FragmentValidation final std::vector &errors) const override; //! makes a copy of FragmentValidation object and returns a MolVSValidations //! pointer to it - virtual boost::shared_ptr copy() const override { + boost::shared_ptr copy() const override { return boost::make_shared(*this); } }; @@ -121,7 +121,7 @@ class RDKIT_MOLSTANDARDIZE_EXPORT NeutralValidation final std::vector &errors) const override; //! makes a copy of NeutralValidation object and returns a MolVSValidations //! pointer to it - virtual boost::shared_ptr copy() const override { + boost::shared_ptr copy() const override { return boost::make_shared(*this); } }; @@ -134,7 +134,7 @@ class RDKIT_MOLSTANDARDIZE_EXPORT IsotopeValidation final std::vector &errors) const override; //! makes a copy of IsotopeValidation object and returns a MolVSValidations //! pointer to it - virtual boost::shared_ptr copy() const override { + boost::shared_ptr copy() const override { return boost::make_shared(*this); } }; @@ -150,7 +150,7 @@ class RDKIT_MOLSTANDARDIZE_EXPORT MolVSValidation : public ValidationMethod { MolVSValidation( const std::vector> validations); MolVSValidation(const MolVSValidation &other); - ~MolVSValidation(); + ~MolVSValidation() override; std::vector validate( const ROMol &mol, bool reportAllFailures) const override; diff --git a/Code/GraphMol/MolStandardize/Wrap/Tautomer.cpp b/Code/GraphMol/MolStandardize/Wrap/Tautomer.cpp index ca1b5e688..251a27630 100644 --- a/Code/GraphMol/MolStandardize/Wrap/Tautomer.cpp +++ b/Code/GraphMol/MolStandardize/Wrap/Tautomer.cpp @@ -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)); } diff --git a/Code/GraphMol/MonomerInfo.h b/Code/GraphMol/MonomerInfo.h index 4c79462db..af9b5dadd 100644 --- a/Code/GraphMol/MonomerInfo.h +++ b/Code/GraphMol/MonomerInfo.h @@ -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(new AtomPDBResidueInfo(*this)); } diff --git a/Code/GraphMol/QueryAtom.h b/Code/GraphMol/QueryAtom.h index b71d23049..fd5da19c0 100644 --- a/Code/GraphMol/QueryAtom.h +++ b/Code/GraphMol/QueryAtom.h @@ -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; diff --git a/Code/GraphMol/QueryBond.h b/Code/GraphMol/QueryBond.h index 529fd5308..6a0ecc00b 100644 --- a/Code/GraphMol/QueryBond.h +++ b/Code/GraphMol/QueryBond.h @@ -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}; diff --git a/Code/GraphMol/QueryOps.h b/Code/GraphMol/QueryOps.h index 026cbdf87..eba7f336f 100644 --- a/Code/GraphMol/QueryOps.h +++ b/Code/GraphMol/QueryOps.h @@ -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()); bool res; if (this->d_val < 0) { @@ -728,7 +728,7 @@ class RDKIT_GRAPHMOL_EXPORT AtomRingQuery } //! returns a copy of this query - Queries::Query *copy() const { + Queries::Query *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 *copy() const { + Queries::Query *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 { 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 { } //! returns a copy of this query - Queries::Query *copy() const { + Queries::Query *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 *copy() const { + Queries::Query *copy() const override { HasPropWithValueQuery *res = new HasPropWithValueQuery(this->propname, this->val, this->tolerance); res->setNegation(this->getNegation()); @@ -945,7 +945,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 { @@ -978,7 +978,7 @@ class HasPropWithValueQuery } //! returns a copy of this query - Queries::Query *copy() const { + Queries::Query *copy() const override { HasPropWithValueQuery *res = new HasPropWithValueQuery(this->propname, this->val); @@ -1012,7 +1012,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 { @@ -1047,7 +1047,7 @@ class HasPropWithValueQuery } //! returns a copy of this query - Queries::Query *copy() const { + Queries::Query *copy() const override { HasPropWithValueQuery *res = new HasPropWithValueQuery( this->propname, this->val, this->tol); diff --git a/Code/GraphMol/SLNParse/SLNParse.h b/Code/GraphMol/SLNParse/SLNParse.h index 1a8658074..b9d9218d9 100644 --- a/Code/GraphMol/SLNParse/SLNParse.h +++ b/Code/GraphMol/SLNParse/SLNParse.h @@ -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; diff --git a/Code/GraphMol/SanitException.h b/Code/GraphMol/SanitException.h index 202fc0334..d1aca7af9 100644 --- a/Code/GraphMol/SanitException.h +++ b/Code/GraphMol/SanitException.h @@ -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 &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 d_atomIndices; diff --git a/Code/GraphMol/SmilesParse/SmilesParse.h b/Code/GraphMol/SmilesParse/SmilesParse.h index 5ea64e343..c1011ba16 100644 --- a/Code/GraphMol/SmilesParse/SmilesParse.h +++ b/Code/GraphMol/SmilesParse/SmilesParse.h @@ -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; diff --git a/Code/GraphMol/Substruct/catch_tests.cpp b/Code/GraphMol/Substruct/catch_tests.cpp index ba2a7da0a..fd3d93ea8 100644 --- a/Code/GraphMol/Substruct/catch_tests.cpp +++ b/Code/GraphMol/Substruct/catch_tests.cpp @@ -33,11 +33,11 @@ class _IsSubstructOf : public Catch::MatcherBase { _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(); diff --git a/Code/GraphMol/SubstructLibrary/SubstructLibrary.h b/Code/GraphMol/SubstructLibrary/SubstructLibrary.h index 57a4f3c8a..237df8fd8 100644 --- a/Code/GraphMol/SubstructLibrary/SubstructLibrary.h +++ b/Code/GraphMol/SubstructLibrary/SubstructLibrary.h @@ -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(m)); return size() - 1; } - virtual boost::shared_ptr getMol(unsigned int idx) const { + boost::shared_ptr 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(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 getMol(unsigned int idx) const { + boost::shared_ptr getMol(unsigned int idx) const override { if (idx >= mols.size()) throw IndexErrorException(idx); boost::shared_ptr mol(new ROMol); MolPickler::molFromPickle(mols[idx], mol.get()); return mol; } - virtual unsigned int size() const { + unsigned int size() const override { return rdcast(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 getMol(unsigned int idx) const { + boost::shared_ptr getMol(unsigned int idx) const override { if (idx >= mols.size()) throw IndexErrorException(idx); boost::shared_ptr mol(SmilesToMol(mols[idx])); return mol; } - virtual unsigned int size() const { + unsigned int size() const override { return rdcast(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 getMol(unsigned int idx) const { + boost::shared_ptr 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(m); } - virtual unsigned int size() const { + unsigned int size() const override { return rdcast(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 *atomCounts = nullptr; ExplicitBitVect *setOnlyBits = nullptr; const bool tautomericFingerprint = true; diff --git a/Code/GraphMol/Wrap/ResonanceMolSupplier.cpp b/Code/GraphMol/Wrap/ResonanceMolSupplier.cpp index 3c2deb1d5..dedcd7eee 100644 --- a/Code/GraphMol/Wrap/ResonanceMolSupplier.cpp +++ b/Code/GraphMol/Wrap/ResonanceMolSupplier.cpp @@ -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: diff --git a/Code/GraphMol/catch_adjustquery.cpp b/Code/GraphMol/catch_adjustquery.cpp index 71f00deae..2549325bb 100644 --- a/Code/GraphMol/catch_adjustquery.cpp +++ b/Code/GraphMol/catch_adjustquery.cpp @@ -40,12 +40,12 @@ class _IsSubstructOf : public Catch::MatcherBase { 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 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(); diff --git a/Code/GraphMol/resMolSupplierTest.cpp b/Code/GraphMol/resMolSupplierTest.cpp index 61babd60d..4e07ce853 100644 --- a/Code/GraphMol/resMolSupplierTest.cpp +++ b/Code/GraphMol/resMolSupplierTest.cpp @@ -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); } diff --git a/Code/Numerics/SquareMatrix.h b/Code/Numerics/SquareMatrix.h index 032a42629..259bc1ee8 100644 --- a/Code/Numerics/SquareMatrix.h +++ b/Code/Numerics/SquareMatrix.h @@ -31,7 +31,7 @@ class SquareMatrix : public Matrix { // return d_nRows; // } - virtual SquareMatrix &operator*=(TYPE scale) { + SquareMatrix &operator*=(TYPE scale) override { Matrix::operator*=(scale); return *this; } diff --git a/Code/Query/AndQuery.h b/Code/Query/AndQuery.h index 909de14a7..3f07a1d70 100644 --- a/Code/Query/AndQuery.h +++ b/Code/Query/AndQuery.h @@ -24,7 +24,7 @@ class RDKIT_QUERY_EXPORT AndQuery typedef Query 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 *copy() const { + Query *copy() + const override { AndQuery *res = new AndQuery(); typename BASE::CHILD_VECT_CI i; diff --git a/Code/Query/EqualityQuery.h b/Code/Query/EqualityQuery.h index 3f043cbf2..f31aae65a 100644 --- a/Code/Query/EqualityQuery.h +++ b/Code/Query/EqualityQuery.h @@ -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()); if (queryCmp(this->d_val, mfArg, this->d_tol) == 0) { @@ -66,8 +66,8 @@ class RDKIT_QUERY_EXPORT EqualityQuery } } - virtual Query *copy() - const { + Query *copy() + const override { EqualityQuery *res = new EqualityQuery(); 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; diff --git a/Code/Query/GreaterEqualQuery.h b/Code/Query/GreaterEqualQuery.h index 5a6e8909d..e15a4e59e 100644 --- a/Code/Query/GreaterEqualQuery.h +++ b/Code/Query/GreaterEqualQuery.h @@ -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()); if (queryCmp(this->d_val, mfArg, this->d_tol) >= 0) { @@ -50,7 +50,8 @@ class RDKIT_QUERY_EXPORT GreaterEqualQuery return false; } } - Query *copy() const { + Query *copy() + const override { GreaterEqualQuery *res = new GreaterEqualQuery(); @@ -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; diff --git a/Code/Query/GreaterQuery.h b/Code/Query/GreaterQuery.h index 900098a82..d2410579d 100644 --- a/Code/Query/GreaterQuery.h +++ b/Code/Query/GreaterQuery.h @@ -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()); if (queryCmp(this->d_val, mfArg, this->d_tol) > 0) { @@ -51,7 +51,8 @@ class RDKIT_QUERY_EXPORT GreaterQuery } } - Query *copy() const { + Query *copy() + const override { GreaterQuery *res = new GreaterQuery(); 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; diff --git a/Code/Query/LessEqualQuery.h b/Code/Query/LessEqualQuery.h index 4bca19c40..4f47f79c6 100644 --- a/Code/Query/LessEqualQuery.h +++ b/Code/Query/LessEqualQuery.h @@ -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()); if (queryCmp(this->d_val, mfArg, this->d_tol) <= 0) { @@ -51,7 +51,8 @@ class RDKIT_QUERY_EXPORT LessEqualQuery } } - Query *copy() const { + Query *copy() + const override { LessEqualQuery *res = new LessEqualQuery(); @@ -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; diff --git a/Code/Query/LessQuery.h b/Code/Query/LessQuery.h index d04d5ffa1..066f491f7 100644 --- a/Code/Query/LessQuery.h +++ b/Code/Query/LessQuery.h @@ -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()); if (queryCmp(this->d_val, mfArg, this->d_tol) < 0) { @@ -51,7 +51,8 @@ class RDKIT_QUERY_EXPORT LessQuery } } - Query *copy() const { + Query *copy() + const override { LessQuery *res = new LessQuery(); 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; diff --git a/Code/Query/OrQuery.h b/Code/Query/OrQuery.h index 41da99f75..0fce7e667 100644 --- a/Code/Query/OrQuery.h +++ b/Code/Query/OrQuery.h @@ -23,7 +23,7 @@ class RDKIT_QUERY_EXPORT OrQuery typedef Query 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 *copy() const { + Query *copy() + const override { OrQuery *res = new OrQuery(); diff --git a/Code/Query/RangeQuery.h b/Code/Query/RangeQuery.h index ff36e88ab..933d50040 100644 --- a/Code/Query/RangeQuery.h +++ b/Code/Query/RangeQuery.h @@ -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()); int lCmp = queryCmp(this->d_lower, mfArg, this->d_tol); @@ -80,7 +80,8 @@ class RDKIT_QUERY_EXPORT RangeQuery return !tempR; } - Query *copy() const { + Query *copy() + const override { RangeQuery *res = new RangeQuery(); 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 << " ! "; diff --git a/Code/Query/SetQuery.h b/Code/Query/SetQuery.h index 21ab59c76..c434ec0a6 100644 --- a/Code/Query/SetQuery.h +++ b/Code/Query/SetQuery.h @@ -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()); return (this->d_set.find(mfArg) != this->d_set.end()) ^ this->getNegation(); } - Query *copy() const { + Query *copy() + const override { SetQuery *res = new SetQuery(); 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(d_set.size()); } - std::string getFullDescription() const { + std::string getFullDescription() const override { std::ostringstream res; res << this->getDescription() << " val"; if (this->getNegation()) diff --git a/Code/Query/XOrQuery.h b/Code/Query/XOrQuery.h index 8442c7d2c..52759eac9 100644 --- a/Code/Query/XOrQuery.h +++ b/Code/Query/XOrQuery.h @@ -24,7 +24,7 @@ class RDKIT_QUERY_EXPORT XOrQuery typedef Query 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 *copy() const { + Query *copy() + const override { XOrQuery *res = new XOrQuery(); diff --git a/Code/RDBoost/python_streambuf.h b/Code/RDBoost/python_streambuf.h index fdc5cb819..2eba9654f 100644 --- a/Code/RDBoost/python_streambuf.h +++ b/Code/RDBoost/python_streambuf.h @@ -232,7 +232,7 @@ class streambuf : public std::basic_streambuf { } /// 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 { /** 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 { } /// 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 { } /// 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 { 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 { 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 { } /// 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 { 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 { 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(); } diff --git a/Code/RDGeneral/BadFileException.h b/Code/RDGeneral/BadFileException.h index 145b293cc..45c9e3e46 100644 --- a/Code/RDGeneral/BadFileException.h +++ b/Code/RDGeneral/BadFileException.h @@ -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; diff --git a/Code/RDGeneral/Exceptions.h b/Code/RDGeneral/Exceptions.h index ecdbf6e63..4f52bc2bc 100644 --- a/Code/RDGeneral/Exceptions.h +++ b/Code/RDGeneral/Exceptions.h @@ -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; diff --git a/Code/RDGeneral/FileParseException.h b/Code/RDGeneral/FileParseException.h index f4cbfab60..0a4ef5ffc 100644 --- a/Code/RDGeneral/FileParseException.h +++ b/Code/RDGeneral/FileParseException.h @@ -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; diff --git a/Code/RDGeneral/Invariant.h b/Code/RDGeneral/Invariant.h index 52686e5cc..972146f7b 100644 --- a/Code/RDGeneral/Invariant.h +++ b/Code/RDGeneral/Invariant.h @@ -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(); } diff --git a/Code/SimDivPickers/HierarchicalClusterPicker.h b/Code/SimDivPickers/HierarchicalClusterPicker.h index 0574dcf66..815501b4e 100644 --- a/Code/SimDivPickers/HierarchicalClusterPicker.h +++ b/Code/SimDivPickers/HierarchicalClusterPicker.h @@ -76,7 +76,7 @@ class RDKIT_SIMDIVPICKERS_EXPORT HierarchicalClusterPicker : public DistPicker { * \param pickSize - the number items to pick from pool (<= poolSize) */ RDKit::INT_VECT pick(const double *distMat, unsigned int poolSize, - unsigned int pickSize) const; + unsigned int pickSize) const override; /*! \brief This is the function that does the clustering of the items - used *by the picker diff --git a/Code/SimDivPickers/LeaderPicker.h b/Code/SimDivPickers/LeaderPicker.h index ceb8f8e02..7b90d1456 100644 --- a/Code/SimDivPickers/LeaderPicker.h +++ b/Code/SimDivPickers/LeaderPicker.h @@ -108,7 +108,7 @@ class LeaderPicker : public DistPicker { /*! \overload */ RDKit::INT_VECT pick(const double *distMat, unsigned int poolSize, - unsigned int pickSize) const { + unsigned int pickSize) const override { RDKit::INT_VECT iv; return pick(distMat, poolSize, pickSize, iv, default_threshold, default_nthreads); diff --git a/Code/SimDivPickers/MaxMinPicker.h b/Code/SimDivPickers/MaxMinPicker.h index bb1734073..02c623f7b 100644 --- a/Code/SimDivPickers/MaxMinPicker.h +++ b/Code/SimDivPickers/MaxMinPicker.h @@ -123,7 +123,7 @@ class RDKIT_SIMDIVPICKERS_EXPORT MaxMinPicker : public DistPicker { /*! \overload */ RDKit::INT_VECT pick(const double *distMat, unsigned int poolSize, - unsigned int pickSize) const { + unsigned int pickSize) const override { RDKit::INT_VECT iv; return pick(distMat, poolSize, pickSize, iv); }