29 #ifndef CDPL_CHEM_BASICREACTION_HPP
30 #define CDPL_CHEM_BASICREACTION_HPP
35 #include <boost/iterator/indirect_iterator.hpp>
61 typedef std::vector<ComponentPtr> ComponentList;
293 using Reaction::operator=;
381 void removeReactant(std::size_t idx);
388 void removeAgent(std::size_t idx);
395 void removeProduct(std::size_t idx);
400 void removeReactants();
410 void removeProducts();
456 void copyComponents(
const Reaction& rxn);
458 ComponentPtr allocComponent(
const Molecule* mol);
461 ComponentList components;
462 std::size_t agentsStartIdx;
463 std::size_t productsStartIdx;
Definition of class CDPL::Chem::BasicMolecule.
Definition of the preprocessor macro CDPL_CHEM_API.
#define CDPL_CHEM_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of class CDPL::Util::ObjectPool.
Definition of class CDPL::Chem::Reaction.
Concrete Chem::Molecule implementation that owns Chem::BasicAtom and Chem::BasicBond instances.
Definition: BasicMolecule.hpp:60
Default concrete implementation of the Chem::Reaction abstract interface.
Definition: BasicReaction.hpp:57
BasicReaction(const BasicReaction &rxn)
Constructs a copy of the BasicReaction instance rxn.
boost::indirect_iterator< ComponentList::const_iterator, const BasicMolecule > ConstComponentIterator
A constant random access iterator used to iterate over the stored const Chem::BasicMolecule reaction ...
Definition: BasicReaction.hpp:78
ComponentIterator removeComponent(const ComponentIterator &it)
Removes the component referenced by the given iterator.
void copy(const BasicReaction &rxn)
Replaces the current set of reaction components and properties by a copy of the components and proper...
boost::indirect_iterator< ComponentList::iterator, BasicMolecule > ComponentIterator
A mutable random access iterator used to iterate over the stored Chem::BasicMolecule reaction compone...
Definition: BasicReaction.hpp:73
ConstComponentIterator getComponentsEnd(unsigned int role) const
Returns a constant iterator pointing one past the last component with the given reaction role.
ComponentIterator getComponentsEnd(unsigned int role)
Returns a mutable iterator pointing one past the last component with the given reaction role.
ComponentIterator getComponentsEnd()
Returns a mutable iterator pointing one past the last component of the reaction.
std::size_t getNumComponents() const
Returns the total number of components in the reaction.
void removeComponents(unsigned int role)
Removes all components with the specified reaction role.
BasicReaction & operator=(const BasicReaction &rxn)
Replaces the current set of reaction components and properties by a copy of the components and proper...
ConstComponentIterator getComponentsBegin(unsigned int role) const
Returns a constant iterator pointing to the first component with the given reaction role.
BasicReaction()
Constructs an empty BasicReaction instance.
std::size_t getNumComponents(unsigned int role) const
Returns the number of components with the given reaction role.
ComponentIterator getComponentsBegin(unsigned int role)
Returns a mutable iterator pointing to the first component with the given reaction role.
bool containsComponent(const Molecule &mol) const
Tells whether mol is a component of the reaction.
std::shared_ptr< BasicReaction > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated BasicReaction instances.
Definition: BasicReaction.hpp:67
BasicMolecule & addComponent(unsigned int role, const Molecule &mol)
Creates a new reaction component with the specified role that is a copy of the molecule mol.
void removeComponent(std::size_t idx, unsigned int role)
Removes the component at the given index within its reaction role.
unsigned int getComponentRole(const Molecule &mol) const
Returns the reaction role of the component mol (see namespace Chem::ReactionRole).
void swapComponentRoles(unsigned int role1, unsigned int role2)
Swaps the reaction roles of two component groups.
void clear()
Removes all components and clears all properties of the reaction.
BasicReaction(const Reaction &rxn)
Constructs a copy of the Chem::Reaction instance rxn.
Reaction::SharedPointer clone() const
Creates a deep copy of the reaction.
ConstComponentIterator getComponentsBegin() const
Returns a constant iterator pointing to the first component of the reaction.
void copy(const Reaction &rxn)
Replaces the current set of reaction components and properties by a copy of the components and proper...
void removeComponent(std::size_t idx)
Removes the component at the specified index.
ConstComponentIterator getComponentsEnd() const
Returns a constant iterator pointing one past the last component of the reaction.
BasicMolecule & getComponent(std::size_t idx)
Returns a reference to the component at the specified index.
const BasicMolecule & getComponent(std::size_t idx) const
Returns a const reference to the component at the specified index.
~BasicReaction()
Destructor.
BasicMolecule & addComponent(unsigned int role)
Adds a new empty component with the specified reaction role.
ComponentIterator getComponentsBegin()
Returns a mutable iterator pointing to the first component of the reaction.
BasicMolecule & getComponent(std::size_t idx, unsigned int role)
Returns a reference to the component at the given index within its reaction role.
const BasicMolecule & getComponent(std::size_t idx, unsigned int role) const
Returns a const reference to the component at the given index within its reaction role.
std::size_t getComponentIndex(const Molecule &mol) const
Returns the index of the component mol in the reaction.
Abstract base class representing a mutable molecular graph that owns its atoms and bonds.
Definition: Molecule.hpp:53
Abstract base class for chemical reactions composed of role-tagged Chem::Molecule components.
Definition: Reaction.hpp:59
std::shared_ptr< Reaction > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated Reaction instances.
Definition: Reaction.hpp:62
std::shared_ptr< ObjectType > SharedObjectPointer
A smart pointer to a borrowed object that returns the object to the pool on destruction.
Definition: ObjectPool.hpp:71
CDPL_CHEM_API void clearComponents(MolecularGraph &molgraph)
Removes the Chem::MolecularGraphProperty::COMPONENTS property from molgraph.
The namespace of the Chemical Data Processing Library.