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
metrics
PoseMetricContainer.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/metrics/PoseMetricContainer.hh
11
/// @brief container for managing PoseMetricCalculators
12
/// @author John Karanicolas
13
14
15
#ifndef INCLUDED_core_pose_metrics_PoseMetricContainer_hh
16
#define INCLUDED_core_pose_metrics_PoseMetricContainer_hh
17
18
19
// unit headers
20
#include <
core/pose/metrics/PoseMetricContainer.fwd.hh
>
21
22
// package headers
23
#include <
core/pose/Pose.fwd.hh
>
24
#include <
core/pose/signals/DestructionEvent.fwd.hh
>
25
#include <
core/pose/signals/EnergyEvent.fwd.hh
>
26
#include <
core/pose/signals/ConformationEvent.fwd.hh
>
27
#include <basic/MetricValue.fwd.hh>
28
29
// Utility Headers
30
#include <utility/pointer/ReferenceCount.hh>
31
#include <utility/pointer/owning_ptr.hh>
32
33
// C++ Headers
34
#include <map>
35
#include <iostream>
36
37
#include <utility/vector1.hh>
38
39
40
41
42
namespace
core {
43
namespace
pose {
44
namespace
metrics {
45
46
47
/// @brief container for managing PoseMetricCalculators
48
/// @details Attaches to a Pose and listens to Pose signals.
49
/// It then notifies stored PoseMetricCalculators to recalculate as-needed.
50
class
PoseMetricContainer
:
public
utility::pointer::ReferenceCount
{
51
52
53
private
:
// typedefs
54
55
typedef
std::map< std::string, PoseMetricCalculatorOP >
Name2Calculator
;
56
57
58
public
:
// construct/destruct
59
60
61
/// @brief default destructor
62
PoseMetricContainer
();
63
64
65
/// @brief copy constructor
66
/// @warning observation of subject Pose in src not duplicated
67
PoseMetricContainer
(
PoseMetricContainer
const
& src );
68
69
70
/// @brief default destructor
71
virtual
~PoseMetricContainer
();
72
73
74
/// @brief copy assignment
75
/// @warning container keeps observing whatever Pose it was originally observing
76
PoseMetricContainer
&
operator =
(
PoseMetricContainer
const
& src );
77
78
79
public
:
// calculator management
80
81
82
/// @brief clear the list of metric calculators, reset flags
83
void
clear
();
84
85
86
/// @brief get a value out of a PoseMetricCalculator
87
// TODO: should we really be passing a Pose pointer in...? Consider using the internal pose_ptr_;
88
void
get
(
std::string
const
& calculator_name,
std::string
const
& key, basic::MetricValueBase & val,
Pose
const
& this_pose );
89
90
91
/// @brief return a string with the results of a PoseMetricCalculator
92
std::string
print
(
std::string
const
& calculator_name,
std::string
const
& key,
Pose
const
& this_pose );
93
94
95
public
:
// observer interface
96
97
98
/// @brief attach to a Pose
99
void
attach_to
(
core::pose::Pose
& pose );
100
101
102
/// @brief detach from Pose
103
void
detach_from
();
104
105
106
/// @brief is observing a Pose?
107
/// @return the Pose if observing, otherwise NULL
108
Pose
const
*
is_observing
();
109
110
111
/// @brief upon receiving a pose::signals::DestructionEvent, detaches
112
void
on_pose_destruction_change
(
core::pose::signals::DestructionEvent
const
& event );
113
114
115
/// @brief upon receiving a pose:signals::EnergyEvent, sets flag telling
116
/// calculators to refresh energy based calculations
117
void
on_pose_energy_change
(
core::pose::signals::EnergyEvent
const
& event );
118
119
120
/// @brief upon receiving pose::signals::ConformationEvent, sets flag telling
121
/// calculators to refresh structure based calculations
122
void
on_pose_conf_change
(
core::pose::signals::ConformationEvent
const
& event );
123
124
125
private
:
// calculator update
126
127
128
/// @brief set PoseMetricCalculator structure changed flags
129
void
process_structure_change
();
130
131
132
/// @brief set PoseMetricCalculator energy changed flags
133
void
process_energy_change
();
134
135
136
/// @brief get a PoseMetricCalculator by name
137
PoseMetricCalculatorOP
get_calculator
(
std::string
const
& calculator_name );
138
139
140
/// @brief add a PoseMetricCalculator by name
141
void
add_calculator
(
std::string
const
& calculator_name );
142
143
144
/// @brief clone calculators, primarily for copy
145
void
clone_calculators
(
Name2Calculator
const
& calcs );
146
147
148
private
:
// data
149
150
151
/// @brief pointer to the Pose being watched
152
core::pose::Pose
const
*
pose_ptr_
;
153
154
155
/// @brief flag for structure change
156
bool
structure_is_outdated_
;
157
158
159
/// @brief flag for energy change
160
bool
energies_are_outdated_
;
161
162
163
/// @brief the list of metric calculators
164
Name2Calculator
metric_calculators_
;
165
166
};
167
168
169
}
// namespace metrics
170
}
// namespace pose
171
}
// namespace core
172
173
174
#endif
Generated on Sat Jun 1 2013 11:34:17 for Rosetta 3.5 by
1.8.4