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

Data structure representing a hierarchical library of torsion rules organized into categories. More...

#include <TorsionLibrary.hpp>

+ Inheritance diagram for CDPL::ConfGen::TorsionLibrary:

Public Types

typedef std::shared_ptr< TorsionLibrarySharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated TorsionLibrary instances. More...
 
- Public Types inherited from CDPL::ConfGen::TorsionCategory
typedef CategoryList::iterator CategoryIterator
 A mutable iterator over the child categories. More...
 
typedef CategoryList::const_iterator ConstCategoryIterator
 A constant iterator over the child categories. More...
 
typedef RuleList::iterator RuleIterator
 A mutable iterator over the contained rules. More...
 
typedef RuleList::const_iterator ConstRuleIterator
 A constant iterator over the contained rules. More...
 

Public Member Functions

void load (std::istream &is)
 Reads the library content from the input stream is in the XML-based CDPL torsion library format. More...
 
void save (std::ostream &os) const
 Writes the library content to the output stream os in the XML-based CDPL torsion library format. More...
 
void loadDefaults ()
 Loads the built-in CDPL default torsion library. More...
 
- Public Member Functions inherited from CDPL::ConfGen::TorsionCategory
 TorsionCategory ()
 Constructs an empty TorsionCategory instance. More...
 
virtual ~TorsionCategory ()
 Virtual destructor. More...
 
const std::string & getName () const
 Returns the category name. More...
 
void setName (const std::string &name)
 Sets the category name. More...
 
const std::string & getMatchPatternString () const
 Returns the SMARTS string used to perceive bonds belonging to this category. More...
 
void setMatchPatternString (const std::string &ptn_str)
 Sets the SMARTS string used to perceive bonds belonging to this category. More...
 
const Chem::MolecularGraph::SharedPointergetMatchPattern () const
 Returns the molecular graph pattern used to perceive bonds belonging to this category. More...
 
void setMatchPattern (const Chem::MolecularGraph::SharedPointer &ptn)
 Sets the molecular graph pattern used to perceive bonds belonging to this category. More...
 
unsigned int getBondAtom1Type () const
 Returns the atom type of the first central bond atom required by this category. More...
 
void setBondAtom1Type (unsigned int type)
 Sets the atom type of the first central bond atom required by this category. More...
 
unsigned int getBondAtom2Type () const
 Returns the atom type of the second central bond atom required by this category. More...
 
void setBondAtom2Type (unsigned int type)
 Sets the atom type of the second central bond atom required by this category. More...
 
TorsionCategoryaddCategory ()
 Creates and appends a new empty child category. More...
 
TorsionCategoryaddCategory (const TorsionCategory &cat)
 Appends a copy of cat as a child category. More...
 
TorsionRuleaddRule ()
 Creates and appends a new empty torsion rule. More...
 
TorsionRuleaddRule (const TorsionRule &rule)
 Appends a copy of rule as a contained torsion rule. More...
 
std::size_t getNumCategories (bool recursive=false) const
 Returns the number of child categories. More...
 
std::size_t getNumRules (bool recursive=false) const
 Returns the number of contained torsion rules. More...
 
TorsionCategorygetCategory (std::size_t idx)
 Returns the child category at index idx. More...
 
const TorsionCategorygetCategory (std::size_t idx) const
 Returns the child category at index idx. More...
 
TorsionRulegetRule (std::size_t idx)
 Returns the torsion rule at index idx. More...
 
const TorsionRulegetRule (std::size_t idx) const
 Returns the torsion rule at index idx. More...
 
void removeCategory (std::size_t idx)
 Removes the child category at index idx. More...
 
void removeRule (std::size_t idx)
 Removes the torsion rule at index idx. More...
 
void removeCategory (const CategoryIterator &it)
 Removes the child category referenced by it. More...
 
void removeRule (const RuleIterator &it)
 Removes the torsion rule referenced by it. More...
 
CategoryIterator getCategoriesBegin ()
 Returns a mutable iterator pointing to the first child category. More...
 
CategoryIterator getCategoriesEnd ()
 Returns a mutable iterator pointing one past the last child category. More...
 
ConstCategoryIterator getCategoriesBegin () const
 Returns a constant iterator pointing to the first child category. More...
 
ConstCategoryIterator getCategoriesEnd () const
 Returns a constant iterator pointing one past the last child category. More...
 
RuleIterator getRulesBegin ()
 Returns a mutable iterator pointing to the first contained rule. More...
 
RuleIterator getRulesEnd ()
 Returns a mutable iterator pointing one past the last contained rule. More...
 
ConstRuleIterator getRulesBegin () const
 Returns a constant iterator pointing to the first contained rule. More...
 
ConstRuleIterator getRulesEnd () const
 Returns a constant iterator pointing one past the last contained rule. More...
 
void swap (TorsionCategory &cat)
 Swaps the contents of this category with cat. More...
 
void clear ()
 Removes all child categories and contained rules and resets the pattern/atom-type data. More...
 

Static Public Member Functions

static void set (const SharedPointer &lib)
 Sets the globally accessible default torsion library. More...
 
static const SharedPointerget ()
 Returns the globally accessible default torsion library (created on first access). More...
 

Detailed Description

Data structure representing a hierarchical library of torsion rules organized into categories.

TorsionLibrary extends ConfGen::TorsionCategory with XML load/save methods and provides static set()/get() accessors for a process-wide default torsion library.

Member Typedef Documentation

◆ SharedPointer

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

Member Function Documentation

◆ load()

void CDPL::ConfGen::TorsionLibrary::load ( std::istream &  is)

Reads the library content from the input stream is in the XML-based CDPL torsion library format.

Parameters
isThe input stream to read from.

◆ save()

void CDPL::ConfGen::TorsionLibrary::save ( std::ostream &  os) const

Writes the library content to the output stream os in the XML-based CDPL torsion library format.

Parameters
osThe output stream to write to.

◆ loadDefaults()

void CDPL::ConfGen::TorsionLibrary::loadDefaults ( )

Loads the built-in CDPL default torsion library.

◆ set()

static void CDPL::ConfGen::TorsionLibrary::set ( const SharedPointer lib)
static

Sets the globally accessible default torsion library.

Parameters
libThe new default library.

◆ get()

static const SharedPointer& CDPL::ConfGen::TorsionLibrary::get ( )
static

Returns the globally accessible default torsion library (created on first access).

Returns
A const reference to the default torsion library shared pointer.

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