Chemical Data Processing Library C++ API - Version 1.2.0
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 <string>
33 #include <cstddef>
34 
35 #include <boost/ptr_container/ptr_vector.hpp>
36 
40 
41 
42 namespace CDPL
43 {
44 
45  namespace ConfGen
46  {
47 
49  {
50 
51  typedef boost::ptr_vector<TorsionCategory> CategoryList;
52  typedef boost::ptr_vector<TorsionRule> RuleList;
53 
54  public:
55  typedef CategoryList::iterator CategoryIterator;
56  typedef CategoryList::const_iterator ConstCategoryIterator;
57  typedef RuleList::iterator RuleIterator;
58  typedef RuleList::const_iterator ConstRuleIterator;
59 
61 
62  virtual ~TorsionCategory() {}
63 
64  const std::string& getName() const;
65 
66  void setName(const std::string& name);
67 
68  const std::string& getMatchPatternString() const;
69 
70  void setMatchPatternString(const std::string& ptn_str);
71 
73 
75 
76  unsigned int getBondAtom1Type() const;
77 
78  void setBondAtom1Type(unsigned int type);
79 
80  unsigned int getBondAtom2Type() const;
81 
82  void setBondAtom2Type(unsigned int type);
83 
85 
87 
89 
91 
92  std::size_t getNumCategories(bool recursive = false) const;
93 
94  std::size_t getNumRules(bool recursive = false) const;
95 
96  TorsionCategory& getCategory(std::size_t idx);
97 
98  const TorsionCategory& getCategory(std::size_t idx) const;
99 
100  TorsionRule& getRule(std::size_t idx);
101 
102  const TorsionRule& getRule(std::size_t idx) const;
103 
104  void removeCategory(std::size_t idx);
105 
106  void removeRule(std::size_t idx);
107 
109 
110  void removeRule(const RuleIterator& it);
111 
113 
115 
117 
119 
121 
123 
125 
127 
128  void swap(TorsionCategory& cat);
129 
130  void clear();
131 
132  private:
133  void checkCategoryIndex(std::size_t idx, bool it) const;
134 
135  void checkRuleIndex(std::size_t idx, bool it) const;
136 
137  std::string name;
138  std::string matchPatternStr;
140  unsigned int bondAtom1Type;
141  unsigned int bondAtom2Type;
142  RuleList rules;
143  CategoryList categories;
144  };
145  } // namespace ConfGen
146 } // namespace CDPL
147 
148 #endif // CDPL_CONFGEN_TORSIONCATEGORY_HPP
Definition of the preprocessor macro CDPL_CONFGEN_API.
#define CDPL_CONFGEN_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of the class CDPL::Chem::MolecularGraph.
Definition of the class CDPL::ConfGen::TorsionRule.
std::shared_ptr< MolecularGraph > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MolecularGraph instances.
Definition: MolecularGraph.hpp:58
Definition: TorsionCategory.hpp:49
TorsionCategory & addCategory()
void removeCategory(const CategoryIterator &it)
void setBondAtom1Type(unsigned int type)
ConstCategoryIterator getCategoriesBegin() const
const Chem::MolecularGraph::SharedPointer & getMatchPattern() const
void removeRule(std::size_t idx)
unsigned int getBondAtom1Type() const
std::size_t getNumCategories(bool recursive=false) const
const std::string & getName() const
TorsionCategory & addCategory(const TorsionCategory &cat)
const std::string & getMatchPatternString() const
void removeCategory(std::size_t idx)
const TorsionRule & getRule(std::size_t idx) const
RuleList::const_iterator ConstRuleIterator
Definition: TorsionCategory.hpp:58
unsigned int getBondAtom2Type() const
virtual ~TorsionCategory()
Definition: TorsionCategory.hpp:62
ConstRuleIterator getRulesBegin() const
CategoryIterator getCategoriesBegin()
ConstRuleIterator getRulesEnd() const
void setMatchPatternString(const std::string &ptn_str)
void removeRule(const RuleIterator &it)
CategoryList::iterator CategoryIterator
Definition: TorsionCategory.hpp:55
void setMatchPattern(const Chem::MolecularGraph::SharedPointer &ptn)
const TorsionCategory & getCategory(std::size_t idx) const
TorsionRule & addRule(const TorsionRule &rule)
void setBondAtom2Type(unsigned int type)
TorsionCategory & getCategory(std::size_t idx)
TorsionRule & getRule(std::size_t idx)
CategoryIterator getCategoriesEnd()
std::size_t getNumRules(bool recursive=false) const
RuleList::iterator RuleIterator
Definition: TorsionCategory.hpp:57
ConstCategoryIterator getCategoriesEnd() const
void setName(const std::string &name)
void swap(TorsionCategory &cat)
CategoryList::const_iterator ConstCategoryIterator
Definition: TorsionCategory.hpp:56
Definition: TorsionRule.hpp:47
The namespace of the Chemical Data Processing Library.