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
pose
datacache
cacheable_observers.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
//
4
// (c) Copyright Rosetta Commons Member Institutions.
5
// (c) This file is part of the Rosetta software suite and is made available under license.
6
// (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7
// (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8
// (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9
10
/// @file core/pose/datacache/cacheable_observers.hh
11
/// @brief file that has class definitions for a bunch of general CacheableObserver implementations
12
///
13
/// @author Florian Richter (floric@u.washington.edu)
14
15
#ifndef INCLUDED_core_pose_datacache_cacheable_observers_hh
16
#define INCLUDED_core_pose_datacache_cacheable_observers_hh
17
18
// unit headers
19
#include <
core/pose/datacache/cacheable_observers.fwd.hh
>
20
#include <
core/pose/datacache/CacheableObserver.hh
>
21
22
// project headers
23
#include <
core/conformation/signals/LengthEvent.hh
>
24
//#include <core/pose/Pose.fwd.hh>
25
26
// AUTO-REMOVED #include <ObjexxFCL/FArray1D.hh>
27
28
// utility headers
29
#include <utility/signals/Link.hh>
30
31
#include <utility/vector1.hh>
32
#include <ObjexxFCL/FArray1D.fwd.hh>
33
34
35
36
namespace
core {
37
namespace
pose {
38
namespace
datacache {
39
40
41
/// @brief a cacheable observer that keeps track of what length events occured
42
class
LengthEventCollector
:
public
core::pose::datacache::CacheableObserver
{
43
44
45
public
:
// typedefs
46
47
48
typedef
utility::signals::Link
Link
;
49
50
51
public
:
// construct/destruct
52
53
54
/// @brief default constructor
55
LengthEventCollector
();
56
57
58
/// @brief copy constructor
59
/// @warning Subject being observed (represented by Link/pointer) is not copied!
60
LengthEventCollector
(
LengthEventCollector
const
& rval );
61
62
63
/// @brief default destructor
64
/// @remarks detaches during destruction
65
//virtual
66
~LengthEventCollector
();
67
68
69
public
:
// assignment
70
71
72
/// @brief copy assignment
73
/// @warning Subject being observed (represented by Link/pointer) is not copied!
74
LengthEventCollector
&
operator =
(
LengthEventCollector
const
& rval );
75
76
77
public
:
// virtual constructors
78
79
80
/// @brief clone this object
81
/// @warning Subject (represented by Link/pointer) is not copied!
82
pose::datacache::CacheableObserverOP
clone
();
83
84
85
/// @brief create a new instance of this object
86
pose::datacache::CacheableObserverOP
create
();
87
88
89
public
:
// interface
90
91
92
/// @brief is this observer attached to a Pose/Conformation?
93
bool
is_attached
()
const
{
94
return
length_event_link_
.valid(); }
95
96
void
97
clear_events
(){
98
length_events_
.clear(); }
99
100
utility::vector1< core::conformation::signals::LengthEvent >
const
&
101
events
()
const
;
102
103
104
protected
:
// virtual observer interface
105
106
107
/// @brief attach to Pose/Conformation
108
virtual
109
void
attach_impl
(
pose::Pose
& pose );
110
111
112
/// @brief detach from Pose/Conformation
113
virtual
114
void
detach_impl
();
115
116
void
117
on_length_change
(
conformation::signals::LengthEvent
const
& event );
118
119
//data
120
private
:
121
122
void
123
copy_length_events
(
utility::vector1< core::conformation::signals::LengthEvent >
const
&
events
);
124
125
utility::vector1< core::conformation::signals::LengthEvent >
length_events_
;
126
127
Link
length_event_link_
;
128
129
};
130
131
132
/// @brief observer that tracks the fate of a one or more segments (i.e. pose
133
/// residues) of interest.
134
/// note: the convention should be that a segment.second marks the end of the segment
135
/// but is not part of it, i.e. the last position of a segment is segment.second - 1
136
/// reason: some peculiar stuff regarding the meaning of length events
137
class
SpecialSegmentsObserver
:
public
core::pose::datacache::CacheableObserver
{
138
139
public
:
// typedefs
140
typedef
core::pose::datacache::CacheableObserver
Parent
;
141
typedef
utility::signals::Link
Link
;
142
typedef
core::Size
Size
;
143
typedef
std::pair< Size, Size >
Segment
;
144
145
public
:
// construct/destruct, assignment, virtual constructors
146
147
SpecialSegmentsObserver
();
148
149
SpecialSegmentsObserver
(
SpecialSegmentsObserver
const
& rval );
150
151
~SpecialSegmentsObserver
();
152
153
SpecialSegmentsObserver
&
operator =
(
SpecialSegmentsObserver
const
& rval );
154
155
/// @brief clone this object
156
/// @warning Subject (represented by Link/pointer) is not copied!
157
pose::datacache::CacheableObserverOP
clone
();
158
159
/// @brief create a new instance of this object
160
pose::datacache::CacheableObserverOP
create
();
161
162
public
:
//interface
163
164
/// @brief is this observer attached to a Pose/Conformation?
165
bool
is_attached
()
const
{
166
return
length_event_link_
.valid(); }
167
168
utility::vector1< Segment >
const
&
169
segments
()
const
{
170
return
segments_
;
171
}
172
173
void
174
clear
();
175
176
void
177
add_segment
(
178
Size
begin,
179
Size
end
180
);
181
182
/// @brief utility function that sets all elements found in the
183
/// SpecialSegmentsObserver in the pose to value
184
static
185
void
186
set_farray_from_sso
(
187
ObjexxFCL::FArray1D_bool & array,
188
core::pose::Pose
const
& pose,
189
bool
const
value
190
);
191
192
protected
:
// virtual observer interface
193
194
void
195
on_length_change
(
conformation::signals::LengthEvent
const
& event );
196
197
/// @brief attach to Pose/Conformation
198
virtual
199
void
attach_impl
(
pose::Pose
& pose );
200
201
202
/// @brief detach from Pose/Conformation
203
virtual
204
void
detach_impl
();
205
206
private
:
//data
207
208
utility::vector1< Segment >
segments_
;
209
210
Link
length_event_link_
;
211
212
};
//SpecialSegmentsObserver
213
214
}
// namespace datacache
215
}
// namespace pose
216
}
// namespace core
217
218
219
#endif
/* INCLUDED_core_pose_datacache_CacheableObserver_HH */
Generated on Sat Jun 1 2013 11:34:09 for Rosetta 3.5 by
1.8.4