29 #ifndef CDPL_CHEM_BASICREACTION_HPP
30 #define CDPL_CHEM_BASICREACTION_HPP
35 #include <boost/iterator/indirect_iterator.hpp>
60 typedef std::vector<ComponentPtr> ComponentList;
231 using Reaction::operator=;
314 void removeReactant(std::size_t idx);
321 void removeAgent(std::size_t idx);
328 void removeProduct(std::size_t idx);
333 void removeReactants();
343 void removeProducts();
389 void copyComponents(
const Reaction& rxn);
391 ComponentPtr allocComponent(
const Molecule* mol);
394 ComponentList components;
395 std::size_t agentsStartIdx;
396 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.
Default implementation of the Chem::Molecule interface.
Definition: BasicMolecule.hpp:58
Default implementation of the Chem::Reaction interface.
Definition: BasicReaction.hpp:56
BasicReaction(const BasicReaction &rxn)
Constructs a BasicReaction instance that is a copy of the reaction 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:76
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:71
ConstComponentIterator getComponentsEnd(unsigned int role) const
Returns a constant iterator pointing to the end of the reaction components with the specified role.
ComponentIterator getComponentsEnd(unsigned int role)
Returns a mutable iterator pointing to the end of the reaction components with the specified role.
ComponentIterator getComponentsEnd()
Returns a mutable iterator pointing to the end of the reaction components.
std::size_t getNumComponents() const
Returns the total number of reaction components.
void removeComponents(unsigned int role)
Removes all components with the specified 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 beginning of the reaction components with the specified r...
BasicReaction()
Constructs an empty BasicReaction instance.
std::size_t getNumComponents(unsigned int role) const
Returns the number of reaction components with the specified role.
ComponentIterator getComponentsBegin(unsigned int role)
Returns a mutable iterator pointing to the beginning of the reaction components with the specified ro...
bool containsComponent(const Molecule &mol) const
Tells whether the specified molecule is a component of this reaction.
std::shared_ptr< BasicReaction > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated BasicReaction instances.
Definition: BasicReaction.hpp:66
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 reaction component at index idx in the list of components with the specified role.
unsigned int getComponentRole(const Molecule &mol) const
Returns the reaction role of the specified component.
void swapComponentRoles(unsigned int role1, unsigned int role2)
Swaps the reaction roles of the component sets specified by role1 and role2.
void clear()
Removes all components and clears all properties of the reaction.
BasicReaction(const Reaction &rxn)
Constructs a BasicReaction instance that is a copy of the reaction rxn.
Reaction::SharedPointer clone() const
Creates a deep copy of the current reaction state.
ConstComponentIterator getComponentsBegin() const
Returns a constant iterator pointing to the beginning of the reaction components.
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 reaction component at the specified index.
ConstComponentIterator getComponentsEnd() const
Returns a constant iterator pointing to the end of the reaction components.
BasicMolecule & getComponent(std::size_t idx)
Returns a non-const reference to the reaction component at index idx.
const BasicMolecule & getComponent(std::size_t idx) const
Returns a const reference to the reaction component at index idx.
~BasicReaction()
Destructor.
BasicMolecule & addComponent(unsigned int role)
Creates a new reaction component with the specified role.
ComponentIterator getComponentsBegin()
Returns a mutable iterator pointing to the beginning of the reaction components.
BasicMolecule & getComponent(std::size_t idx, unsigned int role)
Returns a non-const reference to the reaction component at index idx in the list of components with t...
const BasicMolecule & getComponent(std::size_t idx, unsigned int role) const
Returns a const reference to the reaction component at index idx in the list of components with the s...
std::size_t getComponentIndex(const Molecule &mol) const
Returns the index of the specified reaction component.
Abstract base class representing a mutable molecular graph that owns and manages its atoms and bonds.
Definition: Molecule.hpp:53
Abstract base class for chemical reactions composed of role-tagged reaction components of type Chem::...
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)
Clears the value of the Chem::MolecularGraphProperty::COMPONENTS property of the molecular graph molg...
The namespace of the Chemical Data Processing Library.