17 #ifndef RD_MOLBUNDLE_AUG2017
18 #define RD_MOLBUNDLE_AUG2017
25 #include <boost/smart_ptr.hpp>
50 virtual const std::vector<boost::shared_ptr<ROMol>> &
getMols()
const {
55 virtual size_t addMol(boost::shared_ptr<ROMol> nmol) {
63 virtual const boost::shared_ptr<ROMol>
getMol(
size_t idx)
const {
68 virtual const boost::shared_ptr<ROMol>
operator[](
size_t idx)
const {
73 std::vector<boost::shared_ptr<ROMol>>
d_mols;
100 size_t addMol(boost::shared_ptr<ROMol> nmol)
override {
103 if (nmol->getNumAtoms() !=
d_mols[0]->getNumAtoms())
105 "all molecules in a bundle must have the same number of atoms");
107 if (nmol->getNumBonds() !=
d_mols[0]->getNumBonds())
109 "all molecules in a bundle must have the same number of bonds");
#define PRECONDITION(expr, mess)
Class to allow us to throw an IndexError from C++ and have it make it back to Python.
FixedMolSizeMolBundle(const FixedMolSizeMolBundle &other)
copy constructor
~FixedMolSizeMolBundle() override
size_t addMol(boost::shared_ptr< ROMol > nmol) override
MolBundle contains a collection of related ROMols.
std::vector< boost::shared_ptr< ROMol > > d_mols
virtual size_t size() const
returns the number of molecules from the bundle
virtual const std::vector< boost::shared_ptr< ROMol > > & getMols() const
returns our molecules
virtual const boost::shared_ptr< ROMol > getMol(size_t idx) const
returns a particular molecule in the bundle
MolBundle(const MolBundle &other)
copy constructor
virtual const boost::shared_ptr< ROMol > operator[](size_t idx) const
returns a particular molecule from the bundle
virtual size_t addMol(boost::shared_ptr< ROMol > nmol)
adds a new molecule and returns the total number of molecules
Class to allow us to throw a ValueError from C++ and have it make it back to Python.