29 #ifndef CDPL_CHEM_BASICREACTION_HPP
30 #define CDPL_CHEM_BASICREACTION_HPP
35 #include <boost/iterator/indirect_iterator.hpp>
57 typedef std::vector<ComponentPtr> ComponentList;
165 using Reaction::operator=;
204 void removeReactant(std::size_t idx);
205 void removeAgent(std::size_t idx);
206 void removeProduct(std::size_t idx);
208 void removeReactants();
210 void removeProducts();
221 void copyComponents(
const Reaction& rxn);
223 ComponentPtr allocComponent(
const Molecule* mol);
226 ComponentList components;
227 std::size_t agentsStartIdx;
228 std::size_t productsStartIdx;
Definition of the 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 the class CDPL::Util::ObjectPool.
Definition of the class CDPL::Chem::Reaction.
BasicMolecule.
Definition: BasicMolecule.hpp:54
BasicReaction.
Definition: BasicReaction.hpp:53
BasicReaction(const BasicReaction &rxn)
Constructs a copy of the BasicReaction instance rxn.
boost::indirect_iterator< ComponentList::const_iterator, const BasicMolecule > ConstComponentIterator
Definition: BasicReaction.hpp:67
ComponentIterator removeComponent(const ComponentIterator &it)
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
Definition: BasicReaction.hpp:66
ConstComponentIterator getComponentsEnd(unsigned int role) const
ComponentIterator getComponentsEnd(unsigned int role)
ComponentIterator getComponentsEnd()
std::size_t getNumComponents() const
Returns the 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
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)
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:63
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 copy of the Chem::Reaction instance rxn.
Reaction::SharedPointer clone() const
Creates a copy of the current reaction state.
ConstComponentIterator getComponentsBegin() const
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
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()
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.
Molecule.
Definition: Molecule.hpp:49
Reaction.
Definition: Reaction.hpp:52
std::shared_ptr< Reaction > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated Reaction instances.
Definition: Reaction.hpp:55
std::shared_ptr< ObjectType > SharedObjectPointer
Definition: ObjectPool.hpp:65
CDPL_CHEM_API void clearComponents(MolecularGraph &molgraph)
The namespace of the Chemical Data Processing Library.