Chemical Data Processing Library C++ API - Version 1.4.0
Public Types | Public Member Functions | List of all members
CDPL::ConfGen::FragmentLibraryEntry Class Reference

Data structure representing a single entry of a conformer generation fragment library. More...

#include <FragmentLibraryEntry.hpp>

Public Types

typedef std::shared_ptr< FragmentLibraryEntrySharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated FragmentLibraryEntry instances. More...
 
typedef boost::indirect_iterator< ConformerDataArray::const_iterator, const ConformerDataConstConformerIterator
 A constant iterator over the stored conformers (dereferences to const ConformerData). More...
 
typedef boost::indirect_iterator< ConformerDataArray::iterator, ConformerDataConformerIterator
 A mutable iterator over the stored conformers (dereferences to ConformerData). More...
 

Public Member Functions

 FragmentLibraryEntry ()
 Constructs an empty FragmentLibraryEntry instance. More...
 
void setHashCode (std::uint64_t hash_code)
 Sets the hash code identifying the entry within the FragmentLibrary. More...
 
std::uint64_t getHashCode () const
 Returns the hash code identifying the entry within the FragmentLibrary. More...
 
void setSMILES (const std::string &smiles)
 Sets the canonical SMILES string describing the stored fragment. More...
 
const std::string & getSMILES () const
 Returns the canonical SMILES string describing the stored fragment. More...
 
void clearConformers ()
 Removes all stored conformers from the entry. More...
 
std::size_t getNumAtoms () const
 Returns the number of atoms of the stored fragment. More...
 
std::size_t getNumConformers () const
 Returns the number of stored conformers. More...
 
void addConformer (const ConformerData::SharedPointer &conf_data)
 Appends the given conformer to the entry. More...
 
const ConformerDatagetConformer (std::size_t idx) const
 Returns a const reference to the stored conformer at index idx. More...
 
ConformerDatagetConformer (std::size_t idx)
 Returns a reference to the stored conformer at index idx. More...
 
ConstConformerIterator getConformersBegin () const
 Returns a constant iterator pointing to the first stored conformer. More...
 
ConstConformerIterator getConformersEnd () const
 Returns a constant iterator pointing one past the last stored conformer. More...
 
ConformerIterator getConformersBegin ()
 Returns a mutable iterator pointing to the first stored conformer. More...
 
ConformerIterator getConformersEnd ()
 Returns a mutable iterator pointing one past the last stored conformer. More...
 
ConstConformerIterator begin () const
 Returns a constant iterator pointing to the first stored conformer (range-based for support). More...
 
ConstConformerIterator end () const
 Returns a constant iterator pointing one past the last stored conformer (range-based for support). More...
 
ConformerIterator begin ()
 Returns a mutable iterator pointing to the first stored conformer (range-based for support). More...
 
ConformerIterator end ()
 Returns a mutable iterator pointing one past the last stored conformer (range-based for support). More...
 
const ConformerDataArraygetData () const
 Returns a const reference to the underlying array of conformer-data smart pointers. More...
 

Detailed Description

Data structure representing a single entry of a conformer generation fragment library.

Each entry is identified by the hash code of the associated ConfGen::CanonicalFragment and stores the canonical SMILES string plus a list of ConformerData instances (one per stored conformer).

Member Typedef Documentation

◆ SharedPointer

A reference-counted smart pointer [SHPTR] for dynamically allocated FragmentLibraryEntry instances.

◆ ConstConformerIterator

typedef boost::indirect_iterator<ConformerDataArray::const_iterator, const ConformerData> CDPL::ConfGen::FragmentLibraryEntry::ConstConformerIterator

A constant iterator over the stored conformers (dereferences to const ConformerData).

◆ ConformerIterator

typedef boost::indirect_iterator<ConformerDataArray::iterator, ConformerData> CDPL::ConfGen::FragmentLibraryEntry::ConformerIterator

A mutable iterator over the stored conformers (dereferences to ConformerData).

Constructor & Destructor Documentation

◆ FragmentLibraryEntry()

CDPL::ConfGen::FragmentLibraryEntry::FragmentLibraryEntry ( )

Constructs an empty FragmentLibraryEntry instance.

Member Function Documentation

◆ setHashCode()

void CDPL::ConfGen::FragmentLibraryEntry::setHashCode ( std::uint64_t  hash_code)

Sets the hash code identifying the entry within the FragmentLibrary.

Parameters
hash_codeThe new hash code.

◆ getHashCode()

std::uint64_t CDPL::ConfGen::FragmentLibraryEntry::getHashCode ( ) const

Returns the hash code identifying the entry within the FragmentLibrary.

Returns
The hash code.

◆ setSMILES()

void CDPL::ConfGen::FragmentLibraryEntry::setSMILES ( const std::string &  smiles)

Sets the canonical SMILES string describing the stored fragment.

Parameters
smilesThe new SMILES string.

◆ getSMILES()

const std::string& CDPL::ConfGen::FragmentLibraryEntry::getSMILES ( ) const

Returns the canonical SMILES string describing the stored fragment.

Returns
A const reference to the SMILES string.

◆ clearConformers()

void CDPL::ConfGen::FragmentLibraryEntry::clearConformers ( )

Removes all stored conformers from the entry.

◆ getNumAtoms()

std::size_t CDPL::ConfGen::FragmentLibraryEntry::getNumAtoms ( ) const

Returns the number of atoms of the stored fragment.

Returns
The number of atoms (zero if no conformer has been added yet).

◆ getNumConformers()

std::size_t CDPL::ConfGen::FragmentLibraryEntry::getNumConformers ( ) const

Returns the number of stored conformers.

Returns
The number of stored conformers.

◆ addConformer()

void CDPL::ConfGen::FragmentLibraryEntry::addConformer ( const ConformerData::SharedPointer conf_data)

Appends the given conformer to the entry.

Parameters
conf_dataA smart pointer to the conformer data to add.

◆ getConformer() [1/2]

const ConformerData& CDPL::ConfGen::FragmentLibraryEntry::getConformer ( std::size_t  idx) const

Returns a const reference to the stored conformer at index idx.

Parameters
idxThe zero-based conformer index.
Returns
A const reference to the conformer.
Exceptions
Base::IndexErrorif the number of stored conformers is zero or idx is not in the range [0, getNumConformers() - 1].

◆ getConformer() [2/2]

ConformerData& CDPL::ConfGen::FragmentLibraryEntry::getConformer ( std::size_t  idx)

Returns a reference to the stored conformer at index idx.

Parameters
idxThe zero-based conformer index.
Returns
A reference to the conformer.
Exceptions
Base::IndexErrorif the number of stored conformers is zero or idx is not in the range [0, getNumConformers() - 1].

◆ getConformersBegin() [1/2]

ConstConformerIterator CDPL::ConfGen::FragmentLibraryEntry::getConformersBegin ( ) const

Returns a constant iterator pointing to the first stored conformer.

Returns
A constant iterator pointing to the first conformer.

◆ getConformersEnd() [1/2]

ConstConformerIterator CDPL::ConfGen::FragmentLibraryEntry::getConformersEnd ( ) const

Returns a constant iterator pointing one past the last stored conformer.

Returns
A constant iterator pointing one past the last conformer.

◆ getConformersBegin() [2/2]

ConformerIterator CDPL::ConfGen::FragmentLibraryEntry::getConformersBegin ( )

Returns a mutable iterator pointing to the first stored conformer.

Returns
A mutable iterator pointing to the first conformer.

◆ getConformersEnd() [2/2]

ConformerIterator CDPL::ConfGen::FragmentLibraryEntry::getConformersEnd ( )

Returns a mutable iterator pointing one past the last stored conformer.

Returns
A mutable iterator pointing one past the last conformer.

◆ begin() [1/2]

ConstConformerIterator CDPL::ConfGen::FragmentLibraryEntry::begin ( ) const

Returns a constant iterator pointing to the first stored conformer (range-based for support).

Returns
A constant iterator pointing to the first conformer.

◆ end() [1/2]

ConstConformerIterator CDPL::ConfGen::FragmentLibraryEntry::end ( ) const

Returns a constant iterator pointing one past the last stored conformer (range-based for support).

Returns
A constant iterator pointing one past the last conformer.

◆ begin() [2/2]

ConformerIterator CDPL::ConfGen::FragmentLibraryEntry::begin ( )

Returns a mutable iterator pointing to the first stored conformer (range-based for support).

Returns
A mutable iterator pointing to the first conformer.

◆ end() [2/2]

ConformerIterator CDPL::ConfGen::FragmentLibraryEntry::end ( )

Returns a mutable iterator pointing one past the last stored conformer (range-based for support).

Returns
A mutable iterator pointing one past the last conformer.

◆ getData()

const ConformerDataArray& CDPL::ConfGen::FragmentLibraryEntry::getData ( ) const

Returns a const reference to the underlying array of conformer-data smart pointers.

Returns
A const reference to the conformer-data array.

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