Chemical Data Processing Library C++ API - Version 1.1.1
BasicPharmacophore.hpp
Go to the documentation of this file.
1 /*
2  * BasicPharmacophore.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_PHARM_BASICPHARMACOPHORE_HPP
30 #define CDPL_PHARM_BASICPHARMACOPHORE_HPP
31 
32 #include <vector>
33 
34 #include <boost/iterator/indirect_iterator.hpp>
35 
36 #include "CDPL/Pharm/APIPrefix.hpp"
39 #include "CDPL/Util/ObjectPool.hpp"
40 
41 
42 namespace CDPL
43 {
44 
45  namespace Pharm
46  {
47 
52  {
53 
55  typedef FeatureCache::SharedObjectPointer FeaturePointer;
56  typedef std::vector<FeaturePointer> FeatureList;
57 
58  public:
62  typedef std::shared_ptr<BasicPharmacophore> SharedPointer;
63 
64  typedef boost::indirect_iterator<FeatureList::iterator, BasicFeature> FeatureIterator;
65  typedef boost::indirect_iterator<FeatureList::const_iterator, const BasicFeature> ConstFeatureIterator;
66 
71 
77 
83 
89  explicit BasicPharmacophore(const FeatureContainer& cntnr);
90 
97 
98  void clear();
99 
100  std::size_t getNumFeatures() const;
101 
107 
113 
119 
125 
126  const BasicFeature& getFeature(std::size_t idx) const;
127 
128  BasicFeature& getFeature(std::size_t idx);
129 
131 
132  void removeFeature(std::size_t idx);
133 
142 
143  bool containsFeature(const Feature& feature) const;
144 
145  std::size_t getFeatureIndex(const Feature& feature) const;
146 
157 
158  using Pharmacophore::operator=;
159 
170 
171  using Pharmacophore::operator+=;
172 
174 
180  void copy(const BasicPharmacophore& pharm);
181 
182  void copy(const Pharmacophore& pharm);
183 
184  void copy(const FeatureContainer& cntnr);
185 
192  void append(const BasicPharmacophore& pharm);
193 
194  void append(const Pharmacophore& pharm);
195 
196  void append(const FeatureContainer& cntnr);
197 
198  void remove(const FeatureContainer& cntnr);
199 
200  private:
201  template <typename T>
202  void doCopy(const T& pharm);
203 
204  template <typename T>
205  void doAppend(const T& pharm);
206 
207  void clearFeatures();
208 
209  void renumberFeatures(std::size_t idx);
210 
211  BasicFeature* createFeature();
212 
213  static void destroyFeature(BasicFeature* feature);
214  static void clearFeature(BasicFeature& feature);
215 
216  FeatureCache featureCache;
217  FeatureList features;
218  };
219  } // namespace Pharm
220 } // namespace CDPL
221 
222 #endif // CDPL_PHARM_BASICPHARMACOPHORE_HPP
APIPrefix.hpp
Definition of the preprocessor macro CDPL_PHARM_API.
CDPL::Pharm::BasicPharmacophore::removeFeature
FeatureIterator removeFeature(const FeatureIterator &it)
Removes the feature specified by the iterator it.
CDPL::Pharm::BasicPharmacophore::getFeature
BasicFeature & getFeature(std::size_t idx)
Returns a non-const reference to the pharmacophore feature at index idx.
CDPL_PHARM_API
#define CDPL_PHARM_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
ObjectPool.hpp
Definition of the class CDPL::Util::ObjectPool.
CDPL::Pharm::BasicFeature
BasicFeature.
Definition: BasicFeature.hpp:48
CDPL::Pharm::BasicPharmacophore::remove
void remove(const FeatureContainer &cntnr)
Removes the pharmacophore features referenced by the feature container cntnr from this Pharmacophore ...
CDPL::Pharm::BasicPharmacophore::getFeaturesBegin
ConstFeatureIterator getFeaturesBegin() const
Returns a constant iterator pointing to the beginning of the features.
CDPL::Pharm::BasicPharmacophore::BasicPharmacophore
BasicPharmacophore(const BasicPharmacophore &pharm)
Constructs a copy of the BasicPharmacophore instance pharm.
CDPL::Pharm::BasicPharmacophore::getFeaturesEnd
FeatureIterator getFeaturesEnd()
Returns a mutable iterator pointing to the end of the features.
CDPL::Pharm::BasicPharmacophore::getFeature
const BasicFeature & getFeature(std::size_t idx) const
Returns a const reference to the pharmacophore feature at index idx.
CDPL::Pharm::BasicPharmacophore::BasicPharmacophore
BasicPharmacophore(const Pharmacophore &pharm)
Constructs a copy of the Pharm::Pharmacophore instance pharm.
CDPL::Pharm::BasicPharmacophore::operator=
BasicPharmacophore & operator=(const BasicPharmacophore &pharm)
Replaces the current set of features by a copy of the features and properties of the pharmacophore ph...
CDPL::Pharm::FeatureContainer
FeatureContainer.
Definition: FeatureContainer.hpp:53
CDPL::Pharm::BasicPharmacophore::removeFeature
void removeFeature(std::size_t idx)
Removes the pharmacophore feature at the specified index.
CDPL::Pharm::BasicPharmacophore::clone
Pharmacophore::SharedPointer clone() const
Creates a copy of the current pharmacophore state.
CDPL::Pharm::BasicPharmacophore::clear
void clear()
Removes all features and clears all properties of the pharmacophore.
CDPL::Pharm::BasicPharmacophore::getNumFeatures
std::size_t getNumFeatures() const
Returns the number of pharmacophore features.
CDPL::Pharm::BasicPharmacophore::append
void append(const FeatureContainer &cntnr)
Extends the current set of pharmacophore features by a copy of the features in the feature container ...
CDPL::Pharm::BasicPharmacophore::containsFeature
bool containsFeature(const Feature &feature) const
Tells whether the specified feature instance is stored in this pharmacophore.
CDPL::Util::ObjectPool< BasicFeature >
CDPL::Pharm::Pharmacophore
Pharmacophore.
Definition: Pharmacophore.hpp:48
CDPL::Pharm::BasicPharmacophore::~BasicPharmacophore
~BasicPharmacophore()
Destructor.
CDPL::Chem::AtomType::T
const unsigned int T
Specifies Hydrogen (Tritium).
Definition: AtomType.hpp:67
CDPL::Pharm::BasicPharmacophore::SharedPointer
std::shared_ptr< BasicPharmacophore > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated BasicPharmacophore instances.
Definition: BasicPharmacophore.hpp:62
CDPL::Pharm::BasicPharmacophore
BasicPharmacophore.
Definition: BasicPharmacophore.hpp:52
CDPL::Pharm::BasicPharmacophore::BasicPharmacophore
BasicPharmacophore()
Constructs an empty BasicPharmacophore instance.
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::Pharm::BasicPharmacophore::addFeature
BasicFeature & addFeature()
Creates a new pharmacophore feature and adds it to the pharmacophore.
CDPL::Pharm::BasicPharmacophore::copy
void copy(const Pharmacophore &pharm)
Replaces the current set of pharmacophore features and properties by a copy of the features and prope...
Pharmacophore.hpp
Definition of the class CDPL::Pharm::Pharmacophore.
CDPL::Pharm::BasicPharmacophore::copy
void copy(const BasicPharmacophore &pharm)
Replaces the current set of features and properties by a copy of the features and properties of the p...
CDPL::Pharm::BasicPharmacophore::operator+=
BasicPharmacophore & operator+=(const BasicPharmacophore &pharm)
Extends the current set of features by a copy of the features in the pharmacophore pharm.
CDPL::Pharm::BasicPharmacophore::getFeatureIndex
std::size_t getFeatureIndex(const Feature &feature) const
Returns the index of the specified feature in this pharmacophore.
BasicFeature.hpp
Definition of the class CDPL::Pharm::BasicFeature.
CDPL::Pharm::BasicPharmacophore::getFeaturesEnd
ConstFeatureIterator getFeaturesEnd() const
Returns a constant iterator pointing to the end of the features.
CDPL::Pharm::Pharmacophore::SharedPointer
std::shared_ptr< Pharmacophore > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated Pharmacophore instances.
Definition: Pharmacophore.hpp:54
CDPL::Pharm::BasicPharmacophore::copy
void copy(const FeatureContainer &cntnr)
Replaces the current set of pharmacophore features and properties by a copy of the features and prope...
CDPL::Pharm::BasicPharmacophore::append
void append(const BasicPharmacophore &pharm)
Extends the current set of features by a copy of the features in the pharmacophore pharm.
CDPL::Pharm::Feature
Feature.
Definition: Feature.hpp:48
CDPL::Pharm::BasicPharmacophore::append
void append(const Pharmacophore &pharm)
Extends the current set of pharmacophore features by a copy of the features in the pharmacophore phar...
CDPL::Pharm::BasicPharmacophore::FeatureIterator
boost::indirect_iterator< FeatureList::iterator, BasicFeature > FeatureIterator
Definition: BasicPharmacophore.hpp:64
CDPL::Pharm::BasicPharmacophore::ConstFeatureIterator
boost::indirect_iterator< FeatureList::const_iterator, const BasicFeature > ConstFeatureIterator
Definition: BasicPharmacophore.hpp:65
CDPL::Pharm::BasicPharmacophore::getFeaturesBegin
FeatureIterator getFeaturesBegin()
Returns a mutable iterator pointing to the beginning of the features.
CDPL::Pharm::BasicPharmacophore::BasicPharmacophore
BasicPharmacophore(const FeatureContainer &cntnr)
Constructs a BasicPharmacophore instance with copies of the features in the Pharm::FeatureContainer i...