Chemical Data Processing Library C++ API - Version 1.1.1
HierarchyViewChain.hpp
Go to the documentation of this file.
1 /*
2  * HierarchyViewChain.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_BIOMOL_HIERARCHYVIEWCHAIN_HPP
30 #define CDPL_BIOMOL_HIERARCHYVIEWCHAIN_HPP
31 
32 #include <cstddef>
33 #include <vector>
34 #include <memory>
35 
36 #include <boost/iterator/indirect_iterator.hpp>
37 
40 #include "CDPL/Util/BitSet.hpp"
41 
42 
43 namespace CDPL
44 {
45 
46  namespace Biomol
47  {
48 
49  class HierarchyViewModel;
50 
55  {
56 
57  friend class HierarchyViewModel;
58 
59  typedef std::shared_ptr<HierarchyViewFragment> FragmentPtr;
60  typedef std::vector<FragmentPtr> FragmentList;
61 
62  public:
63  typedef boost::indirect_iterator<FragmentList::const_iterator, const HierarchyViewFragment> ConstFragmentIterator;
64 
65  std::size_t getNumFragments() const;
66 
67  const HierarchyViewFragment& getFragment(std::size_t idx) const;
68 
70 
72 
74 
76 
77  private:
79  initFragments(true) {}
80 
81  void initFragmentList() const;
82  void visitAtom(const Chem::Atom& atom, HierarchyViewFragment& frag, Util::BitSet& vis_atoms) const;
83 
84  mutable FragmentList fragments;
85  mutable bool initFragments;
86  };
87  } // namespace Biomol
88 } // namespace CDPL
89 
90 #endif // CDPL_BIOMOL_HIERARCHYVIEWCHAIN_HPP
CDPL::Biomol::HierarchyViewModel
HierarchyViewModel.
Definition: HierarchyViewModel.hpp:56
CDPL::Biomol::HierarchyViewChain::getFragmentsBegin
ConstFragmentIterator getFragmentsBegin() const
CDPL::Biomol::HierarchyViewFragment
HierarchyViewFragment.
Definition: HierarchyViewFragment.hpp:48
CDPL::Biomol::HierarchyViewChain::getFragmentsEnd
ConstFragmentIterator getFragmentsEnd() const
CDPL::Biomol::HierarchyViewChain::begin
ConstFragmentIterator begin() const
CDPL::Biomol::HierarchyViewChain
HierarchyViewChain.
Definition: HierarchyViewChain.hpp:55
CDPL::Biomol::HierarchyViewChain::ConstFragmentIterator
boost::indirect_iterator< FragmentList::const_iterator, const HierarchyViewFragment > ConstFragmentIterator
Definition: HierarchyViewChain.hpp:63
CDPL::Biomol::HierarchyViewChain::end
ConstFragmentIterator end() const
CDPL::Util::BitSet
boost::dynamic_bitset BitSet
A dynamic bitset class.
Definition: BitSet.hpp:46
CDPL::Chem::Atom
Atom.
Definition: Atom.hpp:52
BitSet.hpp
Definition of the type CDPL::Util::BitSet.
CDPL::Biomol::HierarchyViewChain::getNumFragments
std::size_t getNumFragments() const
CDPL::Biomol::HierarchyViewNode
HierarchyViewNode.
Definition: HierarchyViewNode.hpp:48
CDPL::Biomol::HierarchyViewChain::getFragment
const HierarchyViewFragment & getFragment(std::size_t idx) const
APIPrefix.hpp
Definition of the preprocessor macro CDPL_BIOMOL_API.
CDPL
The namespace of the Chemical Data Processing Library.
HierarchyViewFragment.hpp
Definition of the class CDPL::Biomol::HierarchyViewFragment.
CDPL_BIOMOL_API
#define CDPL_BIOMOL_API
Tells the compiler/linker which classes, functions and variables are part of the library API.