Chemical Data Processing Library C++ API - Version 1.1.1
Classes | Public Types | Public Member Functions | List of all members
CDPL::Chem::Reactor Class Reference

Reactor. More...

#include <Reactor.hpp>

Public Types

typedef AtomBondMapping ReactionSite
 Stores information about perceived reaction-sites. More...
 
typedef ReactionSubstructureSearch::MappingIterator ReactionSiteIterator
 A mutable random access iterator used to iterate over the perceived reaction-sites. More...
 
typedef ReactionSubstructureSearch::ConstMappingIterator ConstReactionSiteIterator
 A constant random access iterator used to iterate over the perceived reaction-sites. More...
 

Public Member Functions

 Reactor ()
 Constructs and initializes a Reactor instance. More...
 
 Reactor (const Reaction &rxn_pattern)
 Constructs and initializes a Reactor instance for the specified reaction pattern. More...
 
 ~Reactor ()
 Destructor. More...
 
void setReactionPattern (const Reaction &rxn_pattern)
 Allows to specify a new reaction pattern for the transformation of reactants to products. More...
 
bool findReactionSites (Reaction &rxn_target)
 Perceives all possible reaction-sites on the reactants of the given reaction target where the specified reaction pattern can be applied. More...
 
std::size_t getNumReactionSites () const
 Returns the number of recorded reactions-sites in the last call to findReactionSites(). More...
 
ReactionSitegetReactionSite (std::size_t idx)
 Returns a non-const reference to the stored reaction-site data object at index idx. More...
 
const ReactionSitegetReactionSite (std::size_t idx) const
 Returns a const reference to the stored reaction-site data object at index idx. More...
 
ReactionSiteIterator getReactionSitesBegin ()
 Returns a mutable iterator pointing to the beginning of the stored reaction-site data objects. More...
 
ConstReactionSiteIterator getReactionSitesBegin () const
 Returns a constant iterator pointing to the beginning of the stored reaction-site data objects. More...
 
ReactionSiteIterator getReactionSitesEnd ()
 Returns a mutable iterator pointing to the end of the stored reaction-site data objects. More...
 
ConstReactionSiteIterator getReactionSitesEnd () const
 Returns a constant iterator pointing to the end of the stored reaction-site data objects. More...
 
ReactionSiteIterator begin ()
 Returns a mutable iterator pointing to the beginning of the stored reaction-site data objects. More...
 
ConstReactionSiteIterator begin () const
 Returns a constant iterator pointing to the beginning of the stored reaction-site data objects. More...
 
ReactionSiteIterator end ()
 Returns a mutable iterator pointing to the end of the stored reaction-site data objects. More...
 
ConstReactionSiteIterator end () const
 Returns a constant iterator pointing to the end of the stored reaction-site data objects. More...
 
void performReaction (const ReactionSite &rxn_site)
 Performs a transformation of the target reactants to corresponding products at the specified reaction-site. More...
 

Detailed Description

Reactor.

Member Typedef Documentation

◆ ReactionSite

Stores information about perceived reaction-sites.

◆ ReactionSiteIterator

A mutable random access iterator used to iterate over the perceived reaction-sites.

◆ ConstReactionSiteIterator

A constant random access iterator used to iterate over the perceived reaction-sites.

Constructor & Destructor Documentation

◆ Reactor() [1/2]

CDPL::Chem::Reactor::Reactor ( )

Constructs and initializes a Reactor instance.

◆ Reactor() [2/2]

CDPL::Chem::Reactor::Reactor ( const Reaction rxn_pattern)

Constructs and initializes a Reactor instance for the specified reaction pattern.

Parameters
rxn_patternThe reaction pattern describing the transformation of reactants to products.

◆ ~Reactor()

CDPL::Chem::Reactor::~Reactor ( )

Destructor.

Destroys the Reactor instance and frees all allocated resources.

Member Function Documentation

◆ setReactionPattern()

void CDPL::Chem::Reactor::setReactionPattern ( const Reaction rxn_pattern)

Allows to specify a new reaction pattern for the transformation of reactants to products.

Parameters
rxn_patternThe reaction pattern describing the transformation of reactants to products.

◆ findReactionSites()

bool CDPL::Chem::Reactor::findReactionSites ( Reaction rxn_target)

Perceives all possible reaction-sites on the reactants of the given reaction target where the specified reaction pattern can be applied.

The specified Chem::Reaction instance rxn_target serves both as a provider for the starting materials (reactant components) in a later reaction transformation (see performReaction()) as well as a container for the generated reaction products.

Parameters
rxn_targetThe reaction target providing the reactants to be transformed.
Returns
true if matching reaction-sites were found, and false otherwise.
Note
Any reaction-site mappings that were recorded in a previous call to findReactionSites() will be discarded.
See also
performReaction()

◆ getNumReactionSites()

std::size_t CDPL::Chem::Reactor::getNumReactionSites ( ) const

Returns the number of recorded reactions-sites in the last call to findReactionSites().

Returns
The number of recorded reactions-sites in the last call to findReactionSites().

◆ getReactionSite() [1/2]

ReactionSite& CDPL::Chem::Reactor::getReactionSite ( std::size_t  idx)

Returns a non-const reference to the stored reaction-site data object at index idx.

Parameters
idxThe zero-based index of the reaction-site data object to return.
Returns
A non-const reference to the reaction-site data object at index idx.
Exceptions
Base::IndexErrorif no reactions-site data objects are available or idx is not in the range [0, getNumReactionSites() - 1].

◆ getReactionSite() [2/2]

const ReactionSite& CDPL::Chem::Reactor::getReactionSite ( std::size_t  idx) const

Returns a const reference to the stored reaction-site data object at index idx.

Parameters
idxThe zero-based index of the reaction-site data object to return.
Returns
A const reference to the reaction-site data object at index idx.
Exceptions
Base::IndexErrorif no reactions-site data objects are available or idx is not in the range [0, getNumReactionSites() - 1].

◆ getReactionSitesBegin() [1/2]

ReactionSiteIterator CDPL::Chem::Reactor::getReactionSitesBegin ( )

Returns a mutable iterator pointing to the beginning of the stored reaction-site data objects.

Returns
A mutable iterator pointing to the beginning of the stored reaction-site data objects.

◆ getReactionSitesBegin() [2/2]

ConstReactionSiteIterator CDPL::Chem::Reactor::getReactionSitesBegin ( ) const

Returns a constant iterator pointing to the beginning of the stored reaction-site data objects.

Returns
A constant iterator pointing to the beginning of the stored reaction-site data objects.

◆ getReactionSitesEnd() [1/2]

ReactionSiteIterator CDPL::Chem::Reactor::getReactionSitesEnd ( )

Returns a mutable iterator pointing to the end of the stored reaction-site data objects.

Returns
A mutable iterator pointing to the end of the stored reaction-site data objects.

◆ getReactionSitesEnd() [2/2]

ConstReactionSiteIterator CDPL::Chem::Reactor::getReactionSitesEnd ( ) const

Returns a constant iterator pointing to the end of the stored reaction-site data objects.

Returns
A constant iterator pointing to the end of the stored reaction-site data objects.

◆ begin() [1/2]

ReactionSiteIterator CDPL::Chem::Reactor::begin ( )

Returns a mutable iterator pointing to the beginning of the stored reaction-site data objects.

Returns
A mutable iterator pointing to the beginning of the stored reaction-site data objects.

◆ begin() [2/2]

ConstReactionSiteIterator CDPL::Chem::Reactor::begin ( ) const

Returns a constant iterator pointing to the beginning of the stored reaction-site data objects.

Returns
A constant iterator pointing to the beginning of the stored reaction-site data objects.

◆ end() [1/2]

ReactionSiteIterator CDPL::Chem::Reactor::end ( )

Returns a mutable iterator pointing to the end of the stored reaction-site data objects.

Returns
A mutable iterator pointing to the end of the stored reaction-site data objects.

◆ end() [2/2]

ConstReactionSiteIterator CDPL::Chem::Reactor::end ( ) const

Returns a constant iterator pointing to the end of the stored reaction-site data objects.

Returns
A constant iterator pointing to the end of the stored reaction-site data objects.

◆ performReaction()

void CDPL::Chem::Reactor::performReaction ( const ReactionSite rxn_site)

Performs a transformation of the target reactants to corresponding products at the specified reaction-site.

The reactant components of the Chem::Reaction object specified in a prior call to findReactionSites() serve as starting materials for the reaction transformation into corresponding product molecules (according to the set reaction pattern). The input molecules are left unchanged by the transformation. New molecules will be generated that are directly stored as the product components of the given target reaction object. Note that the product molecules generated in a previous call will not be discarded and are still accessible after new products have been generated.

Parameters
rxn_siteSpecifies the reaction-site where the transformation shall take place.
See also
setReactionPattern(), findReactionSites()

The documentation for this class was generated from the following file: