Chemical Data Processing Library C++ API - Version 1.1.1
MMFF94SymbolicAtomTypePatternTable.hpp
Go to the documentation of this file.
1 /*
2  * MMFF94SymbolicAtomTypePatternTable.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_MMFF94SYMBOLICATOMTYPEPATTERNTABLE_HPP
30 #define CDPL_FORCEFIELD_MMFF94SYMBOLICATOMTYPEPATTERNTABLE_HPP
31 
32 #include <cstddef>
33 #include <vector>
34 #include <string>
35 #include <iosfwd>
36 #include <memory>
37 
40 
41 
42 namespace CDPL
43 {
44 
45  namespace ForceField
46  {
47 
49  {
50 
51  public:
52  class Entry;
53 
54  private:
55  typedef std::vector<Entry> DataStorage;
56 
57  public:
58  typedef std::shared_ptr<MMFF94SymbolicAtomTypePatternTable> SharedPointer;
59 
60  typedef DataStorage::const_iterator ConstEntryIterator;
61  typedef DataStorage::iterator EntryIterator;
62 
64  {
65 
66  public:
67  Entry(const Chem::MolecularGraph::SharedPointer& ptn, const std::string& sym_type, bool fallback);
68 
69  bool isFallbackType() const;
70 
72 
73  const std::string& getSymbolicType() const;
74 
75  private:
77  std::string symType;
78  bool fallback;
79  };
80 
82 
83  std::size_t getNumEntries() const;
84 
85  void addEntry(const Chem::MolecularGraph::SharedPointer& ptn, const std::string& sym_type, bool fallback);
86 
87  const Entry& getEntry(std::size_t idx) const;
88 
89  void clear();
90 
91  void removeEntry(std::size_t idx);
92 
94 
96 
98 
100 
102 
104 
106 
108 
110 
111  void load(std::istream& is);
112 
113  void loadDefaults();
114 
115  static void set(const SharedPointer& table);
116 
117  static const SharedPointer& get();
118 
119  private:
120  static SharedPointer defaultTable;
121  DataStorage entries;
122  };
123  } // namespace ForceField
124 } // namespace CDPL
125 
126 #endif // CDPL_FORCEFIELD_MMFF94SYMBOLICATOMTYPEPATTERNTABLE_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
APIPrefix.hpp
Definition of the preprocessor macro CDPL_FORCEFIELD_API.
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable::get
static const SharedPointer & get()
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable::removeEntry
void removeEntry(std::size_t idx)
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable::end
EntryIterator end()
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable::EntryIterator
DataStorage::iterator EntryIterator
Definition: MMFF94SymbolicAtomTypePatternTable.hpp:61
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable::Entry::getPattern
const Chem::MolecularGraph::SharedPointer & getPattern() const
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable::loadDefaults
void loadDefaults()
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable
Definition: MMFF94SymbolicAtomTypePatternTable.hpp:49
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable::Entry::isFallbackType
bool isFallbackType() const
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable::Entry::Entry
Entry(const Chem::MolecularGraph::SharedPointer &ptn, const std::string &sym_type, bool fallback)
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable::getEntriesEnd
ConstEntryIterator getEntriesEnd() const
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable::begin
ConstEntryIterator begin() const
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable::getNumEntries
std::size_t getNumEntries() const
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable::removeEntry
EntryIterator removeEntry(const EntryIterator &it)
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable::clear
void clear()
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable::end
ConstEntryIterator end() const
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable::SharedPointer
std::shared_ptr< MMFF94SymbolicAtomTypePatternTable > SharedPointer
Definition: MMFF94SymbolicAtomTypePatternTable.hpp:58
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable::Entry::getSymbolicType
const std::string & getSymbolicType() const
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable::getEntriesBegin
EntryIterator getEntriesBegin()
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable::MMFF94SymbolicAtomTypePatternTable
MMFF94SymbolicAtomTypePatternTable()
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable::addEntry
void addEntry(const Chem::MolecularGraph::SharedPointer &ptn, const std::string &sym_type, bool fallback)
MolecularGraph.hpp
Definition of the class CDPL::Chem::MolecularGraph.
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable::ConstEntryIterator
DataStorage::const_iterator ConstEntryIterator
Definition: MMFF94SymbolicAtomTypePatternTable.hpp:60
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable::set
static void set(const SharedPointer &table)
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable::begin
EntryIterator begin()
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable::load
void load(std::istream &is)
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable::getEntriesEnd
EntryIterator getEntriesEnd()
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable::Entry
Definition: MMFF94SymbolicAtomTypePatternTable.hpp:64
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable::getEntriesBegin
ConstEntryIterator getEntriesBegin() const
CDPL::ForceField::MMFF94SymbolicAtomTypePatternTable::getEntry
const Entry & getEntry(std::size_t idx) const
CDPL_FORCEFIELD_API
#define CDPL_FORCEFIELD_API
Tells the compiler/linker which classes, functions and variables are part of the library API.