Rosetta
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, PoseMetricCalculatorOPName2Calculator
 

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

◆ Name2Calculator

Constructor & Destructor Documentation

◆ PoseMetricContainer() [1/2]

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

default destructor

default constructor

◆ PoseMetricContainer() [2/2]

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_.

◆ ~PoseMetricContainer()

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

default destructor

References detach_from().

Member Function Documentation

◆ add_calculator()

void core::pose::metrics::PoseMetricContainer::add_calculator ( std::string const &  calculator_name)
private

◆ attach_to()

void core::pose::metrics::PoseMetricContainer::attach_to ( core::pose::Pose pose)

◆ clear()

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

◆ clone_calculators()

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

clone calculators, primarily for copy

References metric_calculators_.

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

◆ detach_from()

void core::pose::metrics::PoseMetricContainer::detach_from ( )

◆ get()

void core::pose::metrics::PoseMetricContainer::get ( std::string const &  calculator_name,
std::string const &  key,
basic::MetricValueBase &  val,
Pose const &  this_pose 
)

◆ get_calculator()

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

◆ is_observing()

Pose const * core::pose::metrics::PoseMetricContainer::is_observing ( )

is observing a Pose?

Returns
the Pose if observing, otherwise NULL

References pose_ptr_.

◆ on_pose_conf_change()

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

◆ on_pose_destruction_change()

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

◆ on_pose_energy_change()

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

◆ operator=()

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_.

◆ print()

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

◆ process_energy_change()

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

◆ process_structure_change()

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

◆ energies_are_outdated_

bool core::pose::metrics::PoseMetricContainer::energies_are_outdated_
private

◆ metric_calculators_

Name2Calculator core::pose::metrics::PoseMetricContainer::metric_calculators_
private

◆ pose_ptr_

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

◆ structure_is_outdated_

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: