Rosetta 3.5
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
core
fragment
FragID_Iterator.cc
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/FragID_Iterator.cc
12
/// @brief
13
/// @author Oliver Lange ( olange@u.washington.edu)
14
/// @date
15
16
// Unit Headers
17
#include <
core/fragment/FragID_Iterator.hh
>
18
19
// Package Headers
20
#include <
core/fragment/FragID.hh
>
21
#include <
core/fragment/Frame.hh
>
22
#include <
core/fragment/FrameIteratorWorker_.hh
>
23
#include <
core/fragment/FrameList.hh
>
24
#include <
core/fragment/FrameListIterator_.hh
>
25
26
// Project Headers
27
// AUTO-REMOVED #include <core/kinematics/MoveMap.hh>
28
#include <
core/types.hh
>
29
30
// ObjexxFCL Headers
31
32
// Utility headers
33
// AUTO-REMOVED #include <utility/vector1.hh>
34
#include <utility/pointer/ReferenceCount.hh>
35
36
// std Headers
37
// AUTO-REMOVED #include <iterator>
38
39
#include <
core/fragment/FrameIterator.hh
>
40
#include <utility/vector1.hh>
41
42
43
/* Just a mad thought: with fragments becoming ever more "Residue" like one might want to use the
44
packer to choose a combination of good fragments instead of makeing independent choices.
45
I guess, it is only a question of keeping the combinatorics in control...
46
maybe it makes sense to pack with only "unconfident" regions of the backbone flexible ..
47
*/
48
49
namespace
core {
50
namespace
fragment {
51
52
FragID_Iterator::FragID_Iterator
(
FrameIterator
it ) : it_( it.it_ ), ipos_(1) {}
53
FragID_Iterator::FragID_Iterator
(
FrameIteratorWorker_OP
it ) : it_( it ), ipos_(1) {}
54
FragID_Iterator::FragID_Iterator
( FrameList::iterator it ) : it_( new
FrameListIterator_
( it ) ), ipos_( 1 ) {}
55
56
FragID_Iterator::~FragID_Iterator
() {}
57
58
FragID_Iterator::FragID_Iterator
() : it_( NULL ) {}
59
60
bool
FragID_Iterator::operator !=
(
FragID_Iterator
const
& fi)
const
{
61
return
(*
it_
) != (*fi.
it_
) ||
ipos_
!= fi.
ipos_
;
62
}
63
64
bool
FragID_Iterator::operator ==
(
FragID_Iterator
const
& fi)
const
{
65
return
!
operator!=
( fi);
66
}
67
68
FragID_Iterator
&
FragID_Iterator::operator++
() {
69
// std::cout << "it - nr_frags " << (*it_)->nr_frags() << std::endl;
70
// std::cout << "ipos_ " << ipos_ << std::endl;
71
if
( (*it_)->nr_frags() >
ipos_
) {
72
++
ipos_
;
73
}
else
{
74
// if we assume that NEVER an empty frame is in the fragset we can avoid the use of eit
75
// this assumption is TRUE now: we require the FrameIterator to always show to a valid frame
76
// while ( ++it != eit ) {
77
// if (it_->nr_frags() ) break;
78
// }
79
// ipos_ = 1;
80
++(*it_);
81
ipos_
= 1;
82
}
83
return
*
this
;
84
}
85
86
FragID_Iterator
&
FragID_Iterator::operator+
(
Size
offset ) {
87
for
(
Size
i = 1; i<=offset ; i++ )
operator
++();
88
return
*
this
;
89
}
90
91
FragID_Iterator
&
FragID_Iterator::operator =
(
FragID_Iterator
const
& itr ) {
92
it_
=itr.
it_
;
//copy the pointers to the real iterators
93
ipos_
= itr.
ipos_
;
94
return
*
this
;
95
}
96
97
FragID
FragID_Iterator::frag_id
() {
98
return
FragID
(
it_
->frame_ptr() , (*it_)->frag_id(
ipos_
) );
99
}
100
101
FragID
FragID_Iterator::operator*
() {
102
return
frag_id
();
103
}
104
105
// can't provide that operator, can I ? Could point to a member instance of FragID
106
// normally this operator is never used to actually asked for the pointer to something...
107
FragID
*
FragID_Iterator::operator->
() {
108
my_frag_id_
=
frag_id
();
109
return
&
my_frag_id_
;
110
}
111
112
113
}
114
}
Generated on Sat Jun 1 2013 11:32:34 for Rosetta 3.5 by
1.8.4