「view this page in B3 βῆτα server」

Revisions №59429

branch: master 「№59429」
Commited by: Rocco Moretti
GitHub commit link: 「b4d9eff21f9a491b」 「№2183」
Difference from previous tested commit:  code diff
Commit date: 2017-04-24 10:23:57

Merge pull request #2183 from RosettaCommons/roccomoretti/restype_destructor_observer Add ResidueType destruction observer system For classes (mainly in scoring) which need to cache per-ResidueType data, but want to do it in a way that doesn't preserve the lifetime of the associated ResidueType, they can cache the data based on the (raw) pointer to the ResidueType. However, if the ResidueType is deleted, there's issues with an invalid pointer sticking around. To get around this, add an observer system (like the observer system in Pose), which is specifically for informing those classes about ResidueType destruction, so they can appropriately clear their cache of the soon-to-be-deleted ResidueType reference. This approach was decided on after a short discussion with @aleaverfay. In addition to cleaning up some raw ResidueType pointer uses which were not needed (which involved adding pointer accessors to Pose/Conformation/Residue in addition to the reference accessors), the following classes were hooked into the observer system: LKB_ResidueInfo, CartesianBondedEnergy, FA_ElecEnergy, FACTSPotential, and FullatomCustomPairDistanceEnergy. This fixes issues #2006 and #2021 . The only test changes expected are the central_class_modification, and a number of cosmetic changes resulting from when count pair data gets loaded.

...