Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ConstantLengthFragSetIterator_.hh
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 // :noTabs=false:tabSize=4:indentSize=4:
4 //
5 // (c) Copyright Rosetta Commons Member Institutions.
6 // (c) This file is part of the Rosetta software suite and is made available under license.
7 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
8 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
9 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
10 
11 /// @file core/fragments/ConstantLengthFragSet.hh
12 /// @brief yields a simple implementation of a fragset
13 /// @author Oliver Lange ( olange@u.washington.edu)
14 /// @date Wed Aug 22 12:08:31 2007
15 ///
16 
17 #ifndef INCLUDED_core_fragment_ConstantLengthFragSetIterator__HH
18 #define INCLUDED_core_fragment_ConstantLengthFragSetIterator__HH
19 
20 // Unit Headers
21 //#include <core/fragment/ConstantLengthFragSet.fwd.hh>
22 
23 // Package Headers
26 // AUTO-REMOVED #include <core/fragment/FrameIterator.fwd.hh>
27 
28 // AUTO-REMOVED #include <core/fragment/ConstantLengthFragSet.fwd.hh>
29 
30 
31 // Project Headers
32 #include <core/types.hh>
33 
34 // Utility headers
35 #include <utility/vector1.fwd.hh>
36 #include <utility/pointer/ReferenceCount.hh>
37 
38 // std Headers
39 // AUTO-REMOVED #include <iterator>
40 
41 #include <core/fragment/Frame.hh>
42 #include <utility/vector1.hh>
43 
44 
45 /* Just a mad thought: with fragments becoming ever more "Residue" like one might want to use the
46  packer to choose a combination of good fragments instead of makeing independent choices.
47  I guess, it is only a question of keeping the combinatorics in control...
48  maybe it makes sense to pack with only "unconfident" regions of the backbone flexible ..
49 */
50 
51 namespace core {
52 namespace fragment {
53 
54 
56  friend class ConstantLengthFragSet;
57 protected:
58  ConstantLengthFragSetIterator_( FrameList::const_iterator it, FrameList::const_iterator eit ) : it_( it ), eit_( eit ) {
59  if ( it != eit ) {
60  if ( *it ) {
61  if ( (*it)->nr_frags() ) return;
62  }
63  ++(*this); //if not already pointing to some valid stuff ... increment until it is
64  }
65  };
66 
67  bool operator != ( FrameIteratorWorker_ const& fiw ) const {
68  ConstantLengthFragSetIterator_ const& fsit ( dynamic_cast< ConstantLengthFragSetIterator_ const& > ( fiw ) );
69  return it_!=fsit.it_;
70  };
71 
73  while ( ++it_ != eit_ ) {
74  if (*it_) {
75  if ( (*it_)->nr_frags() ) return *this;
76  }
77  };
78  return *this;
79  }
80 
82  ConstantLengthFragSetIterator_ const& fsit ( dynamic_cast< ConstantLengthFragSetIterator_ const& > ( fiw ) );
83  it_= fsit.it_;
84  return *this;
85  }
86 
88  return *it_;
89  }
90 
91  FrameCOP frame_ptr() const {
92  return *it_;
93  }
94 
95 private:
96  FrameList::const_iterator it_;
97  FrameList::const_iterator eit_;
98 };
99 
100 }
101 }
102 
103 #endif