Rosetta
|
container for managing PoseMetricCalculators More...
#include <PoseMetricContainer.hh>
Public Member Functions | |
PoseMetricContainer () | |
default destructor More... | |
PoseMetricContainer (PoseMetricContainer const &src) | |
copy constructor More... | |
~PoseMetricContainer () override | |
default destructor More... | |
PoseMetricContainer & | operator= (PoseMetricContainer const &src) |
copy assignment More... | |
void | clear () |
clear the list of metric calculators, reset flags More... | |
void | get (std::string const &calculator_name, std::string const &key, basic::MetricValueBase &val, Pose const &this_pose) |
get a value out of a PoseMetricCalculator More... | |
std::string | print (std::string const &calculator_name, std::string const &key, Pose const &this_pose) |
return a string with the results of a PoseMetricCalculator More... | |
void | attach_to (core::pose::Pose &pose) |
attach to a Pose More... | |
void | detach_from () |
detach from Pose More... | |
Pose const * | is_observing () |
is observing a Pose? More... | |
void | on_pose_destruction_change (core::pose::signals::DestructionEvent const &event) |
upon receiving a pose::signals::DestructionEvent, detaches More... | |
void | on_pose_energy_change (core::pose::signals::EnergyEvent const &event) |
upon receiving a pose:signals::EnergyEvent, sets flag telling calculators to refresh energy based calculations More... | |
void | on_pose_conf_change (core::pose::signals::ConformationEvent const &event) |
upon receiving pose::signals::ConformationEvent, sets flag telling calculators to refresh structure based calculations More... | |
Private Types | |
typedef std::map< std::string, PoseMetricCalculatorOP > | Name2Calculator |
Private Member Functions | |
void | process_structure_change () |
set PoseMetricCalculator structure changed flags More... | |
void | process_energy_change () |
set PoseMetricCalculator energy changed flags More... | |
PoseMetricCalculatorOP | get_calculator (std::string const &calculator_name) |
get a PoseMetricCalculator by name More... | |
void | add_calculator (std::string const &calculator_name) |
add a PoseMetricCalculator by name More... | |
void | clone_calculators (Name2Calculator const &calcs) |
clone calculators, primarily for copy More... | |
Private Attributes | |
core::pose::Pose const * | pose_ptr_ |
pointer to the Pose being watched More... | |
bool | structure_is_outdated_ |
flag for structure change More... | |
bool | energies_are_outdated_ |
flag for energy change More... | |
Name2Calculator | metric_calculators_ |
the list of metric calculators More... | |
container for managing PoseMetricCalculators
Attaches to a Pose and listens to Pose signals. It then notifies stored PoseMetricCalculators to recalculate as-needed.
|
private |
core::pose::metrics::PoseMetricContainer::PoseMetricContainer | ( | ) |
default destructor
default constructor
core::pose::metrics::PoseMetricContainer::PoseMetricContainer | ( | PoseMetricContainer const & | src | ) |
copy constructor
References clone_calculators(), and metric_calculators_.
|
override |
default destructor
References detach_from().
|
private |
add a PoseMetricCalculator by name
References core::pose::metrics::CalculatorFactory::Instance(), metric_calculators_, and core::pose::metrics::CalculatorFactory::retrieve_calculator().
Referenced by get_calculator().
void core::pose::metrics::PoseMetricContainer::attach_to | ( | core::pose::Pose & | pose | ) |
attach to a Pose
References core::pose::Pose::attach_conformation_obs(), core::pose::Pose::attach_destruction_obs(), core::pose::Pose::attach_energy_obs(), detach_from(), energies_are_outdated_, on_pose_conf_change(), on_pose_destruction_change(), on_pose_energy_change(), pose_ptr_, and structure_is_outdated_.
void core::pose::metrics::PoseMetricContainer::clear | ( | ) |
clear the list of metric calculators, reset flags
References energies_are_outdated_, metric_calculators_, and structure_is_outdated_.
Referenced by operator=().
|
private |
clone calculators, primarily for copy
References metric_calculators_.
Referenced by operator=(), and PoseMetricContainer().
void core::pose::metrics::PoseMetricContainer::detach_from | ( | ) |
detach from Pose
References core::pose::Pose::detach_conformation_obs(), core::pose::Pose::detach_destruction_obs(), core::pose::Pose::detach_energy_obs(), on_pose_conf_change(), on_pose_destruction_change(), on_pose_energy_change(), and pose_ptr_.
Referenced by attach_to(), on_pose_destruction_change(), and ~PoseMetricContainer().
void core::pose::metrics::PoseMetricContainer::get | ( | std::string const & | calculator_name, |
std::string const & | key, | ||
basic::MetricValueBase & | val, | ||
Pose const & | this_pose | ||
) |
get a value out of a PoseMetricCalculator
References get_calculator(), and protocols::hybridization::val.
|
private |
get a PoseMetricCalculator by name
References add_calculator(), energies_are_outdated_, metric_calculators_, pose_ptr_, process_energy_change(), process_structure_change(), and structure_is_outdated_.
Pose const * core::pose::metrics::PoseMetricContainer::is_observing | ( | ) |
void core::pose::metrics::PoseMetricContainer::on_pose_conf_change | ( | core::pose::signals::ConformationEvent const & | event | ) |
upon receiving pose::signals::ConformationEvent, sets flag telling calculators to refresh structure based calculations
References structure_is_outdated_.
Referenced by attach_to(), and detach_from().
void core::pose::metrics::PoseMetricContainer::on_pose_destruction_change | ( | core::pose::signals::DestructionEvent const & | event | ) |
upon receiving a pose::signals::DestructionEvent, detaches
References detach_from().
Referenced by attach_to(), and detach_from().
void core::pose::metrics::PoseMetricContainer::on_pose_energy_change | ( | core::pose::signals::EnergyEvent const & | event | ) |
upon receiving a pose:signals::EnergyEvent, sets flag telling calculators to refresh energy based calculations
References energies_are_outdated_.
Referenced by attach_to(), and detach_from().
PoseMetricContainer & core::pose::metrics::PoseMetricContainer::operator= | ( | PoseMetricContainer const & | src | ) |
copy assignment
References clear(), clone_calculators(), and metric_calculators_.
std::string core::pose::metrics::PoseMetricContainer::print | ( | std::string const & | calculator_name, |
std::string const & | key, | ||
Pose const & | this_pose | ||
) |
return a string with the results of a PoseMetricCalculator
References get_calculator().
|
private |
set PoseMetricCalculator energy changed flags
References energies_are_outdated_, and metric_calculators_.
Referenced by get_calculator().
|
private |
set PoseMetricCalculator structure changed flags
References metric_calculators_, and structure_is_outdated_.
Referenced by get_calculator().
|
private |
flag for energy change
Referenced by attach_to(), clear(), get_calculator(), on_pose_energy_change(), and process_energy_change().
|
private |
the list of metric calculators
Referenced by add_calculator(), clear(), clone_calculators(), get_calculator(), operator=(), PoseMetricContainer(), process_energy_change(), and process_structure_change().
|
private |
pointer to the Pose being watched
Referenced by attach_to(), detach_from(), get_calculator(), and is_observing().
|
private |
flag for structure change
Referenced by attach_to(), clear(), get_calculator(), on_pose_conf_change(), and process_structure_change().