Chemical Data Processing Library C++ API - Version 1.4.0
FragmentLibraryEntry.hpp
Go to the documentation of this file.
1 /*
2  * FragmentLibraryEntry.hpp
3  *
4  * This file is part of the ConfGenical 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_FRAGMENTLIBRARYENTRY_HPP
30 #define CDPL_CONFGEN_FRAGMENTLIBRARYENTRY_HPP
31 
32 #include <string>
33 #include <cstddef>
34 #include <cstdint>
35 #include <memory>
36 
37 #include <boost/iterator/indirect_iterator.hpp>
38 
41 
42 
43 namespace CDPL
44 {
45 
46  namespace ConfGen
47  {
48 
56  {
57 
58  public:
62  typedef std::shared_ptr<FragmentLibraryEntry> SharedPointer;
63 
65  typedef boost::indirect_iterator<ConformerDataArray::const_iterator, const ConformerData> ConstConformerIterator;
67  typedef boost::indirect_iterator<ConformerDataArray::iterator, ConformerData> ConformerIterator;
68 
73 
78  void setHashCode(std::uint64_t hash_code);
79 
84  std::uint64_t getHashCode() const;
85 
90  void setSMILES(const std::string& smiles);
91 
96  const std::string& getSMILES() const;
97 
102 
107  std::size_t getNumAtoms() const;
108 
113  std::size_t getNumConformers() const;
114 
120 
127  const ConformerData& getConformer(std::size_t idx) const;
128 
135  ConformerData& getConformer(std::size_t idx);
136 
142 
148 
154 
160 
166 
172 
178 
184 
189  const ConformerDataArray& getData() const;
190 
191  private:
192  std::uint64_t hashCode;
193  std::string smiles;
194  ConformerDataArray conformers;
195  };
196  } // namespace ConfGen
197 } // namespace CDPL
198 
199 #endif // CDPL_CONFGEN_FRAGMENTLIBRARYENTRY_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 type CDPL::ConfGen::ConformerDataArray.
Container for the 3D coordinates of a generated conformer plus its associated energy value.
Definition: ConformerData.hpp:51
std::shared_ptr< ConformerData > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated ConformerData instances.
Definition: ConformerData.hpp:55
Data structure representing a single entry of a conformer generation fragment library.
Definition: FragmentLibraryEntry.hpp:56
const ConformerData & getConformer(std::size_t idx) const
Returns a const reference to the stored conformer at index idx.
ConformerIterator begin()
Returns a mutable iterator pointing to the first stored conformer (range-based for support).
void clearConformers()
Removes all stored conformers from the entry.
ConformerData & getConformer(std::size_t idx)
Returns a reference to the stored conformer at index idx.
ConformerIterator end()
Returns a mutable iterator pointing one past the last stored conformer (range-based for support).
const std::string & getSMILES() const
Returns the canonical SMILES string describing the stored fragment.
FragmentLibraryEntry()
Constructs an empty FragmentLibraryEntry instance.
void addConformer(const ConformerData::SharedPointer &conf_data)
Appends the given conformer to the entry.
std::size_t getNumAtoms() const
Returns the number of atoms of the stored fragment.
std::shared_ptr< FragmentLibraryEntry > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated FragmentLibraryEntry instances.
Definition: FragmentLibraryEntry.hpp:62
boost::indirect_iterator< ConformerDataArray::const_iterator, const ConformerData > ConstConformerIterator
A constant iterator over the stored conformers (dereferences to const ConformerData).
Definition: FragmentLibraryEntry.hpp:65
ConstConformerIterator getConformersBegin() const
Returns a constant iterator pointing to the first stored conformer.
std::uint64_t getHashCode() const
Returns the hash code identifying the entry within the FragmentLibrary.
ConformerIterator getConformersBegin()
Returns a mutable iterator pointing to the first stored conformer.
void setHashCode(std::uint64_t hash_code)
Sets the hash code identifying the entry within the FragmentLibrary.
const ConformerDataArray & getData() const
Returns a const reference to the underlying array of conformer-data smart pointers.
ConstConformerIterator getConformersEnd() const
Returns a constant iterator pointing one past the last stored conformer.
ConformerIterator getConformersEnd()
Returns a mutable iterator pointing one past the last stored conformer.
void setSMILES(const std::string &smiles)
Sets the canonical SMILES string describing the stored fragment.
ConstConformerIterator begin() const
Returns a constant iterator pointing to the first stored conformer (range-based for support).
boost::indirect_iterator< ConformerDataArray::iterator, ConformerData > ConformerIterator
A mutable iterator over the stored conformers (dereferences to ConformerData).
Definition: FragmentLibraryEntry.hpp:67
std::size_t getNumConformers() const
Returns the number of stored conformers.
ConstConformerIterator end() const
Returns a constant iterator pointing one past the last stored conformer (range-based for support).
std::vector< ConformerData::SharedPointer > ConformerDataArray
Dynamically-sized array of shared pointers to ConfGen::ConformerData objects.
Definition: ConformerDataArray.hpp:46
The namespace of the Chemical Data Processing Library.