Chemical Data Processing Library C++ API - Version 1.1.1
MMFF94AtomTypePropertyTable.hpp
Go to the documentation of this file.
1 /*
2  * MMFF94AtomTypePropertyTable.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_FORCEFIELD_MMFF94ATOMTYPEPROPERTYTABLE_HPP
30 #define CDPL_FORCEFIELD_MMFF94ATOMTYPEPROPERTYTABLE_HPP
31 
32 #include <cstddef>
33 #include <iosfwd>
34 #include <unordered_map>
35 #include <memory>
36 #include <functional>
37 
38 #include <boost/iterator/transform_iterator.hpp>
39 
41 
42 
43 namespace CDPL
44 {
45 
46  namespace ForceField
47  {
48 
50  {
51 
52  public:
53  class Entry;
54 
55  private:
56  typedef std::unordered_map<unsigned int, Entry> DataStorage;
57 
58  public:
59  typedef std::shared_ptr<MMFF94AtomTypePropertyTable> SharedPointer;
60 
62  {
63 
64  public:
65  Entry();
66 
67  Entry(unsigned int atom_type, unsigned int atomic_no, std::size_t num_nbrs, std::size_t valence,
68  bool has_pi_lp, unsigned int mltb_desig, bool is_arom, bool lin_bnd_ang, bool has_mb_or_sb);
69 
70  unsigned int getAtomType() const;
71 
72  unsigned int getAtomicNumber() const;
73 
74  std::size_t getNumNeighbors() const;
75 
76  std::size_t getValence() const;
77 
78  bool hasPiLonePair() const;
79 
80  unsigned int getMultiBondDesignator() const;
81 
82  bool isAromaticAtomType() const;
83 
84  bool formsLinearBondAngle() const;
85 
87 
88  operator bool() const;
89 
90  private:
91  unsigned int atomType;
92  unsigned int atomicNo;
93  std::size_t numNeighbors;
94  std::size_t valence;
95  bool hasPiLonePr;
96  unsigned int mltbDesig;
97  bool isAroType;
98  bool hasLinBondAng;
99  bool hasMultiOrSingleBonds;
100  bool initialized;
101  };
102 
103  typedef boost::transform_iterator<std::function<const Entry&(const DataStorage::value_type&)>,
104  DataStorage::const_iterator>
106 
107  typedef boost::transform_iterator<std::function<Entry&(DataStorage::value_type&)>,
108  DataStorage::iterator>
110 
112 
113  void addEntry(unsigned int atom_type, unsigned int atomic_no, std::size_t num_nbrs, std::size_t valence,
114  bool has_pi_lp, unsigned int mltb_desig, bool is_arom, bool lin_bnd_ang, bool has_mb_or_sb);
115 
116  const Entry& getEntry(unsigned int atom_type) const;
117 
118  std::size_t getNumEntries() const;
119 
120  void clear();
121 
122  bool removeEntry(unsigned int atom_type);
123 
125 
127 
129 
131 
133 
135 
137 
139 
141 
142  void load(std::istream& is);
143 
144  void loadDefaults();
145 
146  static void set(const SharedPointer& table);
147 
148  static const SharedPointer& get();
149 
150  private:
151  static SharedPointer defaultTable;
152  DataStorage entries;
153  };
154  } // namespace ForceField
155 } // namespace CDPL
156 
157 #endif // CDPL_FORCEFIELD_MMFF94ATOMTYPEPROPERTYTABLE_HPP
APIPrefix.hpp
Definition of the preprocessor macro CDPL_FORCEFIELD_API.
CDPL::ForceField::MMFF94AtomTypePropertyTable::Entry::isAromaticAtomType
bool isAromaticAtomType() const
CDPL::ForceField::MMFF94AtomTypePropertyTable::MMFF94AtomTypePropertyTable
MMFF94AtomTypePropertyTable()
CDPL::ForceField::MMFF94AtomTypePropertyTable::ConstEntryIterator
boost::transform_iterator< std::function< const Entry &(const DataStorage::value_type &)>, DataStorage::const_iterator > ConstEntryIterator
Definition: MMFF94AtomTypePropertyTable.hpp:105
CDPL::ForceField::MMFF94AtomTypePropertyTable::getEntriesEnd
ConstEntryIterator getEntriesEnd() const
CDPL::ForceField::MMFF94AtomTypePropertyTable::getEntriesEnd
EntryIterator getEntriesEnd()
CDPL::ForceField::MMFF94AtomTypePropertyTable::set
static void set(const SharedPointer &table)
CDPL::ForceField::MMFF94AtomTypePropertyTable::SharedPointer
std::shared_ptr< MMFF94AtomTypePropertyTable > SharedPointer
Definition: MMFF94AtomTypePropertyTable.hpp:59
CDPL::ForceField::MMFF94AtomTypePropertyTable::Entry::getMultiBondDesignator
unsigned int getMultiBondDesignator() const
CDPL::ForceField::MMFF94AtomTypePropertyTable::load
void load(std::istream &is)
bool
CDPL::ForceField::MMFF94AtomTypePropertyTable::Entry::formsLinearBondAngle
bool formsLinearBondAngle() const
CDPL::ForceField::MMFF94AtomTypePropertyTable::begin
ConstEntryIterator begin() const
CDPL::ForceField::MMFF94AtomTypePropertyTable::Entry::getNumNeighbors
std::size_t getNumNeighbors() const
CDPL::ForceField::MMFF94AtomTypePropertyTable::Entry::formsMultiOrSingleBonds
bool formsMultiOrSingleBonds() const
CDPL::ForceField::MMFF94AtomTypePropertyTable::Entry::hasPiLonePair
bool hasPiLonePair() const
CDPL::ForceField::MMFF94AtomTypePropertyTable::EntryIterator
boost::transform_iterator< std::function< Entry &(DataStorage::value_type &)>, DataStorage::iterator > EntryIterator
Definition: MMFF94AtomTypePropertyTable.hpp:109
CDPL::ForceField::MMFF94AtomTypePropertyTable::end
EntryIterator end()
CDPL::ForceField::MMFF94AtomTypePropertyTable::end
ConstEntryIterator end() const
CDPL::ForceField::MMFF94AtomTypePropertyTable::addEntry
void addEntry(unsigned int atom_type, unsigned int atomic_no, std::size_t num_nbrs, std::size_t valence, bool has_pi_lp, unsigned int mltb_desig, bool is_arom, bool lin_bnd_ang, bool has_mb_or_sb)
CDPL::ForceField::MMFF94AtomTypePropertyTable::removeEntry
EntryIterator removeEntry(const EntryIterator &it)
CDPL::ForceField::MMFF94AtomTypePropertyTable::getEntry
const Entry & getEntry(unsigned int atom_type) const
CDPL::ForceField::MMFF94AtomTypePropertyTable::removeEntry
bool removeEntry(unsigned int atom_type)
CDPL::ForceField::MMFF94AtomTypePropertyTable::Entry::Entry
Entry(unsigned int atom_type, unsigned int atomic_no, std::size_t num_nbrs, std::size_t valence, bool has_pi_lp, unsigned int mltb_desig, bool is_arom, bool lin_bnd_ang, bool has_mb_or_sb)
CDPL::ForceField::MMFF94AtomTypePropertyTable::getNumEntries
std::size_t getNumEntries() const
CDPL::ForceField::MMFF94AtomTypePropertyTable::getEntriesBegin
ConstEntryIterator getEntriesBegin() const
CDPL::ForceField::MMFF94AtomTypePropertyTable::begin
EntryIterator begin()
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::ForceField::MMFF94AtomTypePropertyTable::Entry::getAtomicNumber
unsigned int getAtomicNumber() const
CDPL::ForceField::MMFF94AtomTypePropertyTable::loadDefaults
void loadDefaults()
CDPL_FORCEFIELD_API
#define CDPL_FORCEFIELD_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
CDPL::ForceField::MMFF94AtomTypePropertyTable::Entry::getValence
std::size_t getValence() const
CDPL::ForceField::MMFF94AtomTypePropertyTable::Entry::Entry
Entry()
CDPL::ForceField::MMFF94AtomTypePropertyTable
Definition: MMFF94AtomTypePropertyTable.hpp:50
CDPL::ForceField::MMFF94AtomTypePropertyTable::getEntriesBegin
EntryIterator getEntriesBegin()
CDPL::ForceField::MMFF94AtomTypePropertyTable::Entry
Definition: MMFF94AtomTypePropertyTable.hpp:62
CDPL::ForceField::MMFF94AtomTypePropertyTable::Entry::getAtomType
unsigned int getAtomType() const
CDPL::ForceField::MMFF94AtomTypePropertyTable::clear
void clear()
CDPL::ForceField::MMFF94AtomTypePropertyTable::get
static const SharedPointer & get()