Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MetricValueGetter.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 //
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
11 /// @brief
12 /// @author Colin Smith
14 
15 #include <core/pose/Pose.hh>
16 
17 #include <utility/vector1.hh>
18 #include <basic/MetricValue.hh>
19 
20 
21 namespace protocols{
22 namespace toolbox {
23 namespace pose_metric_calculators {
24 
26  calculator_(""),
27  key_(""),
28  metric_value_template_(NULL)
29 {}
30 
32  std::string const & calculator,
33  std::string const & key,
34  basic::MetricValueBaseCOP metric_value_template
35 ) :
36  calculator_(calculator),
37  key_(key),
38  metric_value_template_(metric_value_template)
39 {}
40 
42  MetricValueGetter const & getter
43 )
44 {
45  *this = getter;
46 }
47 
49 {}
50 
51 MetricValueGetter const &
53  MetricValueGetter const & getter
54 )
55 {
56  calculator_ = getter.calculator();
57  key_ = getter.key();
59 
60  return *this;
61 }
62 
63 std::string const &
65 {
66  return calculator_;
67 }
68 
69 void
71  std::string const & calculator
72 )
73 {
75 }
76 
77 std::string const &
79 {
80  return key_;
81 }
82 
83 void
85  std::string const & key
86 )
87 {
88  key_ = key;
89 }
90 
91 basic::MetricValueBaseCOP
93 {
95 }
96 
97 void
99  basic::MetricValueBaseCOP metric_value_template
100 )
101 {
103 }
104 
105 basic::MetricValueBaseOP
107  core::pose::Pose const & pose
108 ) const
109 {
110  runtime_assert(metric_value_template_);
111  basic::MetricValueBaseOP new_metric_value(metric_value_template_->clone());
112  pose.metric(calculator_, key_, *new_metric_value);
113  return new_metric_value;
114 }
115 
116 } // namespace pose_metric_calculators
117 } // namespace toolbox
118 } // namespace protocols
119 
120