Chemical Data Processing Library Python API - Version 1.2.0
Public Member Functions | List of all members
CDPL.Chem.BasicReaction Class Reference

BasicReaction. More...

+ Inheritance diagram for CDPL.Chem.BasicReaction:

Public Member Functions

None __init__ ()
 Constructs an empty BasicReaction instance.
 
None __init__ (BasicReaction mol)
 Initializes a copy of the BasicReaction instance mol. More...
 
None __init__ (Reaction mol)
 Initializes the BasicReaction instance. More...
 
BasicMolecule addComponent (int role)
 Creates a new reaction component with the specified role. More...
 
BasicMolecule addComponent (int role, Molecule mol)
 Creates a new reaction component with the specified role that is a copy of the molecule mol. More...
 
None copy (BasicReaction rxn)
 Replaces the current set of reaction components and properties by a copy of the components and properties of the reaction rxn. More...
 
None copy (Reaction rxn)
 Replaces the current set of reaction components and properties by a copy of the components and properties of the reaction rxn. More...
 
BasicReaction assign (BasicReaction rxn)
 Replaces the current set of reaction components and properties by a copy of the components and properties of the reaction rxn. More...
 
BasicReaction assign (Reaction rxn)
 Replaces the current set of reaction components and properties by a copy of the components and properties of the reaction rxn. More...
 
- Public Member Functions inherited from CDPL.Chem.Reaction
None clear ()
 Removes all components and clears all properties of the reaction.
 
bool containsComponent (Molecule mol)
 Tells whether the specified molecule is a component of this reaction. More...
 
int getComponentRole (Molecule mol)
 Returns the reaction role of the specified component. More...
 
int getComponentIndex (Molecule mol)
 Returns the index of the specified reaction component. More...
 
int getNumComponents (int role)
 Returns the number of reaction components with the specified role. More...
 
int getNumComponents ()
 Returns the number of reaction components. More...
 
Molecule getComponent (int idx, int role)
 Returns a reference to the reaction component at index idx in the list of components with the specified role. More...
 
Molecule getComponent (int idx)
 Returns a reference to the reaction component at index idx. More...
 
None removeComponents (int role)
 Removes all components with the specified role. More...
 
None removeComponent (int idx, int role)
 Removes the reaction component at index idx in the list of components with the specified role. More...
 
None removeComponent (int idx)
 Removes the reaction component at the specified index. More...
 
None swapComponentRoles (int role1, int role2)
 Swaps the reaction roles of the component sets specified by role1 and role2. More...
 
Reaction clone ()
 Creates a copy of the current reaction state. More...
 
ComponentSequence getReactants ()
 
ComponentSequence getAgents ()
 
ComponentSequence getProducts ()
 
None invokeCopyPostprocessingFunctions (Reaction src_rxn)
 
tuple __getstate__ ()
 
Molecule __getitem__ (int idx)
 
Base.Any __getitem__ (Base.LookupKey key)
 
None __delitem__ (int idx)
 
bool __delitem__ (Base.LookupKey key)
 
bool __contains__ (Molecule mol)
 Returns the result of the membership test operation mol in self. More...
 
bool __contains__ (Base.LookupKey key)
 Returns the result of the membership test operation key in self. More...
 
None __setitem__ (Base.LookupKey key, Base.Any value)
 
int __len__ ()
 
- Public Member Functions inherited from CDPL.Base.PropertyContainer
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
int getNumProperties ()
 Returns the number of property entries. More...
 
Any getPropertyOrDefault (LookupKey key, Any def_value)
 
list getPropertyKeys ()
 
list getPropertyValues ()
 
list getProperties ()
 Returns a reference to itself. More...
 
None setProperty (LookupKey key, Any value)
 
bool removeProperty (LookupKey key)
 Clears the value of the property specified by key. More...
 
Any getProperty (LookupKey key, bool throw_=False)
 Returns the value of the property specified by key. More...
 
bool isPropertySet (LookupKey key)
 Tells whether or not a value has been assigned to the property specified by key. More...
 
None clearProperties ()
 Clears all property values.
 
None addProperties (PropertyContainer cntnr)
 Adds the property value entries in the PropertyContainer instance cntnr. More...
 
None copyProperties (PropertyContainer cntnr)
 Replaces the current set of properties by a copy of the entries in cntnr. More...
 
None swap (PropertyContainer cntnr)
 Exchanges the properties of this container with the properties of the container cntnr. More...
 
Any __getitem__ (LookupKey key)
 
bool __contains__ (LookupKey key)
 Returns the result of the membership test operation key in self. More...
 
None __setitem__ (LookupKey key, Any value)
 
bool __delitem__ (LookupKey key)
 

Additional Inherited Members

- Static Public Member Functions inherited from CDPL.Chem.Reaction
None registerCopyPostprocessingFunction (VoidMoleculeMolecularGraphFunctor func)
 
- Properties inherited from CDPL.Chem.Reaction
 reactants = property(getReactants)
 
 agents = property(getAgents)
 
 products = property(getProducts)
 
 numComponents = property(getNumComponents)
 
- Properties inherited from CDPL.Base.PropertyContainer
 objectID = property(getObjectID)
 
 propertyKeys = property(getPropertyKeys)
 
 propertyValues = property(getPropertyValues)
 
 properties = property(getProperties)
 
 numProperties = property(getNumProperties)
 

Detailed Description

BasicReaction.

Constructor & Destructor Documentation

◆ __init__() [1/2]

None CDPL.Chem.BasicReaction.__init__ ( BasicReaction  mol)

Initializes a copy of the BasicReaction instance mol.

Parameters
molThe BasicReaction instance to copy.

◆ __init__() [2/2]

None CDPL.Chem.BasicReaction.__init__ ( Reaction  mol)

Initializes the BasicReaction instance.

Parameters
mol

Member Function Documentation

◆ addComponent() [1/2]

BasicMolecule CDPL.Chem.BasicReaction.addComponent ( int  role)

Creates a new reaction component with the specified role.

Parameters
roleA flag specifying the reaction role of the new component (see namespace Chem.ReactionRole).
Returns
A reference to the newly created component molecule.
Exceptions
Base.ValueErrorif the value of role is not Chem.ReactionRole.REACTANT, Chem.ReactionRole.AGENT or Chem.ReactionRole.PRODUCT.

Reimplemented from CDPL.Chem.Reaction.

◆ addComponent() [2/2]

BasicMolecule CDPL.Chem.BasicReaction.addComponent ( int  role,
Molecule  mol 
)

Creates a new reaction component with the specified role that is a copy of the molecule mol.

Parameters
roleA flag specifying the reaction role of the new component (see namespace Chem.ReactionRole).
molSpecifies a molecule that provides the data for the new reaction component (note that only explicitly assigned molecule, atom and bond properties will be copied).
Returns
A reference to the newly created component molecule.
Exceptions
Base.ValueErrorif the value of role is not Chem.ReactionRole.REACTANT, Chem.ReactionRole.AGENT or Chem.ReactionRole.PRODUCT.

◆ copy() [1/2]

None CDPL.Chem.BasicReaction.copy ( BasicReaction  rxn)

Replaces the current set of reaction components and properties by a copy of the components and properties of the reaction rxn.

Parameters
rxnThe reaction to copy.

◆ copy() [2/2]

None CDPL.Chem.BasicReaction.copy ( Reaction  rxn)

Replaces the current set of reaction components and properties by a copy of the components and properties of the reaction rxn.

Parameters
rxnThe reaction to copy.

Reimplemented from CDPL.Chem.Reaction.

◆ assign() [1/2]

BasicReaction CDPL.Chem.BasicReaction.assign ( BasicReaction  rxn)

Replaces the current set of reaction components and properties by a copy of the components and properties of the reaction rxn.

Internally calls copy() to perform the actual work.

Parameters
rxnThe reaction to copy.
Returns
self

◆ assign() [2/2]

BasicReaction CDPL.Chem.BasicReaction.assign ( Reaction  rxn)

Replaces the current set of reaction components and properties by a copy of the components and properties of the reaction rxn.

Internally calls copy() to perform the actual work.

Parameters
rxnThe reaction to copy.
Returns
self

Reimplemented from CDPL.Chem.Reaction.