33#ifndef RDKIT_ENUMERATEBASE_H
34#define RDKIT_ENUMERATEBASE_H
79 m_rxn.initReactantMatchers();
91 virtual operator bool()
const {
93 return static_cast<bool>(*m_enumerator);
118 virtual std::vector<MOL_SPTR_VECT>
next() = 0;
150 std::stringstream ss;
160 std::stringstream ss(text);
165#ifdef RDK_USE_BOOST_SERIALIZATION
166 friend class boost::serialization::access;
167 template <
class Archive>
168 void save(Archive &ar,
const unsigned int)
const {
179 template <
class Archive>
180 void load(Archive &ar,
const unsigned int ) {
188 ReactionPickler::reactionFromPickle(pickle, m_rxn);
191 m_initialEnumerator = EnumerationStrategyPickler::fromPickle(pickle);
194 BOOST_SERIALIZATION_SPLIT_MEMBER();
198#ifdef RDK_USE_BOOST_SERIALIZATION
#define PRECONDITION(expr, mess)
This is a class for storing and applying general chemical reactions.
unsigned int getNumAgentTemplates() const
unsigned int getNumReactantTemplates() const
unsigned int getNumProductTemplates() const
std::string getState() const
const EnumerationStrategyBase & getEnumerator()
return the current enumeration strategy
virtual void initFromStream(std::istream &ss)=0
initializes from a stream pickle
virtual ~EnumerateLibraryBase()
virtual std::string Serialize() const
returns a string with a serialized (pickled) representation
boost::shared_ptr< EnumerationStrategyBase > m_enumerator
virtual std::vector< MOL_SPTR_VECT > next()=0
EnumerateLibraryBase(const EnumerateLibraryBase &rhs)
Copy constructor.
EnumerateLibraryBase()
default constructor
const EnumerationTypes::RGROUPS & getPosition() const
virtual std::vector< std::vector< std::string > > nextSmiles()
virtual void initFromString(const std::string &text)
initializes from a string pickle
virtual void toStream(std::ostream &ss) const =0
serializes (pickles) to a stream
void reset()
reset the enumeration to the beginning.
EnumerateLibraryBase(const ChemicalReaction &rxn, EnumerationStrategyBase *enumerator=nullptr)
construct with a chemical reaction and an enumeration strategy
void setState(const std::string &)
void resetState()
Reset the enumerator to the beginning.
boost::shared_ptr< EnumerationStrategyBase > m_initialEnumerator
const ChemicalReaction & getReaction() const
returns the underlying chemical reaction
static void pickleReaction(const ChemicalReaction *rxn, std::ostream &ss, unsigned int propertyFlags)
pickles a reaction and sends the results to stream ss
Class to allow us to throw a ValueError from C++ and have it make it back to Python.
#define RDKIT_CHEMREACTIONS_EXPORT
RDKIT_CHEMREACTIONS_EXPORT void pickle(const boost::shared_ptr< EnumerationStrategyBase > &enumerator, std::ostream &ss)
pickles a EnumerationStrategy and adds the results to a stream ss
std::vector< boost::uint64_t > RGROUPS