Rosetta  2021.16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
core::pose::metrics::PoseMetricContainer Class Reference

container for managing PoseMetricCalculators More...

#include <PoseMetricContainer.hh>

Inheritance diagram for core::pose::metrics::PoseMetricContainer:
Inheritance graph
[legend]

Public Member Functions

 PoseMetricContainer ()
 default destructor More...
 
 PoseMetricContainer (PoseMetricContainer const &src)
 copy constructor More...
 
 ~PoseMetricContainer () override
 default destructor More...
 
PoseMetricContaineroperator= (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...
 

Detailed Description

container for managing PoseMetricCalculators

Attaches to a Pose and listens to Pose signals. It then notifies stored PoseMetricCalculators to recalculate as-needed.

Member Typedef Documentation

Constructor & Destructor Documentation

core::pose::metrics::PoseMetricContainer::PoseMetricContainer ( )

default destructor

default constructor

core::pose::metrics::PoseMetricContainer::PoseMetricContainer ( PoseMetricContainer const &  src)

copy constructor

Warning
observation of subject Pose in src not duplicated

References clone_calculators(), and metric_calculators_.

core::pose::metrics::PoseMetricContainer::~PoseMetricContainer ( )
override

default destructor

References detach_from().

Member Function Documentation

void core::pose::metrics::PoseMetricContainer::add_calculator ( std::string const &  calculator_name)
private
void core::pose::metrics::PoseMetricContainer::attach_to ( core::pose::Pose pose)
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=().

void core::pose::metrics::PoseMetricContainer::clone_calculators ( Name2Calculator const &  calcs)
private

clone calculators, primarily for copy

References metric_calculators_.

Referenced by operator=(), and PoseMetricContainer().

void core::pose::metrics::PoseMetricContainer::detach_from ( )
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().

PoseMetricCalculatorOP core::pose::metrics::PoseMetricContainer::get_calculator ( std::string const &  calculator_name)
private
Pose const * core::pose::metrics::PoseMetricContainer::is_observing ( )

is observing a Pose?

Returns
the Pose if observing, otherwise NULL

References pose_ptr_.

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

Warning
container keeps observing whatever Pose it was originally observing

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().

void core::pose::metrics::PoseMetricContainer::process_energy_change ( )
private

set PoseMetricCalculator energy changed flags

References energies_are_outdated_, and metric_calculators_.

Referenced by get_calculator().

void core::pose::metrics::PoseMetricContainer::process_structure_change ( )
private

set PoseMetricCalculator structure changed flags

References metric_calculators_, and structure_is_outdated_.

Referenced by get_calculator().

Member Data Documentation

bool core::pose::metrics::PoseMetricContainer::energies_are_outdated_
private
Name2Calculator core::pose::metrics::PoseMetricContainer::metric_calculators_
private
core::pose::Pose const* core::pose::metrics::PoseMetricContainer::pose_ptr_
private

pointer to the Pose being watched

Referenced by attach_to(), detach_from(), get_calculator(), and is_observing().

bool core::pose::metrics::PoseMetricContainer::structure_is_outdated_
private

flag for structure change

Referenced by attach_to(), clear(), get_calculator(), on_pose_conf_change(), and process_structure_change().


The documentation for this class was generated from the following files: