Chemical Data Processing Library C++ API - Version 1.1.1
TorsionCategory.hpp
Go to the documentation of this file.
1 /*
2  * TorsionCategory.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_CONFGEN_TORSIONCATEGORY_HPP
30 #define CDPL_CONFGEN_TORSIONCATEGORY_HPP
31 
32 #include <vector>
33 #include <string>
34 #include <cstddef>
35 
39 
40 
41 namespace CDPL
42 {
43 
44  namespace ConfGen
45  {
46 
48  {
49 
50  typedef std::vector<TorsionCategory> CategoryList;
51  typedef std::vector<TorsionRule> RuleList;
52 
53  public:
54  typedef CategoryList::iterator CategoryIterator;
55  typedef CategoryList::const_iterator ConstCategoryIterator;
56  typedef RuleList::iterator RuleIterator;
57  typedef RuleList::const_iterator ConstRuleIterator;
58 
60 
61  virtual ~TorsionCategory() {}
62 
63  const std::string& getName() const;
64 
65  void setName(const std::string& name);
66 
67  const std::string& getMatchPatternString() const;
68 
69  void setMatchPatternString(const std::string& ptn_str);
70 
72 
74 
75  unsigned int getBondAtom1Type() const;
76 
77  void setBondAtom1Type(unsigned int type);
78 
79  unsigned int getBondAtom2Type() const;
80 
81  void setBondAtom2Type(unsigned int type);
82 
84 
86 
88 
90 
91  std::size_t getNumCategories(bool recursive = false) const;
92 
93  std::size_t getNumRules(bool recursive = false) const;
94 
95  TorsionCategory& getCategory(std::size_t idx);
96 
97  const TorsionCategory& getCategory(std::size_t idx) const;
98 
99  TorsionRule& getRule(std::size_t idx);
100 
101  const TorsionRule& getRule(std::size_t idx) const;
102 
103  void removeCategory(std::size_t idx);
104 
105  void removeRule(std::size_t idx);
106 
108 
109  void removeRule(const RuleIterator& it);
110 
112 
114 
116 
118 
120 
122 
124 
126 
127  void swap(TorsionCategory& cat);
128 
129  void clear();
130 
131  private:
132  void checkCategoryIndex(std::size_t idx, bool it) const;
133 
134  void checkRuleIndex(std::size_t idx, bool it) const;
135 
136  std::string name;
137  std::string matchPatternStr;
139  unsigned int bondAtom1Type;
140  unsigned int bondAtom2Type;
141  RuleList rules;
142  CategoryList categories;
143  };
144  } // namespace ConfGen
145 } // namespace CDPL
146 
147 #endif // CDPL_CONFGEN_TORSIONCATEGORY_HPP
CDPL::Chem::MolecularGraph::SharedPointer
std::shared_ptr< MolecularGraph > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MolecularGraph instances.
Definition: MolecularGraph.hpp:58
CDPL::ConfGen::TorsionCategory::getCategoriesEnd
CategoryIterator getCategoriesEnd()
CDPL::ConfGen::TorsionCategory::getName
const std::string & getName() const
CDPL::ConfGen::TorsionCategory::getRulesEnd
ConstRuleIterator getRulesEnd() const
CDPL::ConfGen::TorsionCategory::getNumRules
std::size_t getNumRules(bool recursive=false) const
CDPL::ConfGen::TorsionCategory::RuleIterator
RuleList::iterator RuleIterator
Definition: TorsionCategory.hpp:56
CDPL::ConfGen::TorsionCategory::getBondAtom2Type
unsigned int getBondAtom2Type() const
TorsionRule.hpp
Definition of the class CDPL::ConfGen::TorsionRule.
CDPL::ConfGen::TorsionCategory::removeRule
void removeRule(std::size_t idx)
CDPL::ConfGen::TorsionCategory::addCategory
TorsionCategory & addCategory()
CDPL::ConfGen::TorsionCategory::setBondAtom2Type
void setBondAtom2Type(unsigned int type)
CDPL::ConfGen::TorsionCategory::~TorsionCategory
virtual ~TorsionCategory()
Definition: TorsionCategory.hpp:61
CDPL::ConfGen::TorsionRule
Definition: TorsionRule.hpp:47
CDPL::ConfGen::TorsionCategory::addCategory
TorsionCategory & addCategory(const TorsionCategory &cat)
CDPL::ConfGen::TorsionCategory::removeRule
void removeRule(const RuleIterator &it)
CDPL::ConfGen::TorsionCategory::ConstCategoryIterator
CategoryList::const_iterator ConstCategoryIterator
Definition: TorsionCategory.hpp:55
CDPL::ConfGen::TorsionCategory::setMatchPattern
void setMatchPattern(const Chem::MolecularGraph::SharedPointer &ptn)
CDPL::ConfGen::TorsionCategory::setName
void setName(const std::string &name)
CDPL::ConfGen::TorsionCategory::CategoryIterator
CategoryList::iterator CategoryIterator
Definition: TorsionCategory.hpp:54
CDPL::ConfGen::TorsionCategory::addRule
TorsionRule & addRule()
CDPL::ConfGen::TorsionCategory::setMatchPatternString
void setMatchPatternString(const std::string &ptn_str)
CDPL::ConfGen::TorsionCategory::getMatchPattern
const Chem::MolecularGraph::SharedPointer & getMatchPattern() const
CDPL::ConfGen::TorsionCategory::getRulesEnd
RuleIterator getRulesEnd()
CDPL::ConfGen::TorsionCategory::removeCategory
void removeCategory(std::size_t idx)
CDPL::ConfGen::TorsionCategory::getRule
const TorsionRule & getRule(std::size_t idx) const
CDPL::ConfGen::TorsionCategory::getNumCategories
std::size_t getNumCategories(bool recursive=false) const
APIPrefix.hpp
Definition of the preprocessor macro CDPL_CONFGEN_API.
MolecularGraph.hpp
Definition of the class CDPL::Chem::MolecularGraph.
CDPL_CONFGEN_API
#define CDPL_CONFGEN_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
CDPL::ConfGen::TorsionCategory::getCategoriesEnd
ConstCategoryIterator getCategoriesEnd() const
CDPL::ConfGen::TorsionCategory
Definition: TorsionCategory.hpp:48
CDPL::ConfGen::TorsionCategory::TorsionCategory
TorsionCategory()
CDPL::ConfGen::TorsionCategory::getCategoriesBegin
CategoryIterator getCategoriesBegin()
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::ConfGen::TorsionCategory::setBondAtom1Type
void setBondAtom1Type(unsigned int type)
CDPL::ConfGen::TorsionCategory::clear
void clear()
CDPL::ConfGen::TorsionCategory::swap
void swap(TorsionCategory &cat)
CDPL::ConfGen::TorsionCategory::getRulesBegin
RuleIterator getRulesBegin()
CDPL::ConfGen::TorsionCategory::getCategoriesBegin
ConstCategoryIterator getCategoriesBegin() const
CDPL::ConfGen::TorsionCategory::addRule
TorsionRule & addRule(const TorsionRule &rule)
CDPL::ConfGen::TorsionCategory::getMatchPatternString
const std::string & getMatchPatternString() const
CDPL::ConfGen::TorsionCategory::ConstRuleIterator
RuleList::const_iterator ConstRuleIterator
Definition: TorsionCategory.hpp:57
CDPL::ConfGen::TorsionCategory::getRule
TorsionRule & getRule(std::size_t idx)
CDPL::ConfGen::TorsionCategory::removeCategory
void removeCategory(const CategoryIterator &it)
CDPL::ConfGen::TorsionCategory::getCategory
const TorsionCategory & getCategory(std::size_t idx) const
CDPL::ConfGen::TorsionCategory::getBondAtom1Type
unsigned int getBondAtom1Type() const
CDPL::ConfGen::TorsionCategory::getRulesBegin
ConstRuleIterator getRulesBegin() const
CDPL::ConfGen::TorsionCategory::getCategory
TorsionCategory & getCategory(std::size_t idx)