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

Revisions №60570

branch: master 「№60570」
Commited by: Rocco Moretti
GitHub commit link: 「6b183247c2f2d613」 「№3712」
Difference from previous tested commit:  code diff
Commit date: 2019-01-04 18:16:18
linux.clang linux.gcc linux.srlz mac.clang
linux.PyRosetta.unit linux.gcc.python36.PyRosetta4.unit mac.PyRosetta.unit build.clean.debug cppcheck mysql postgres linux.zeromq.debug mpi mpi.serialization linux.icc.build.debug OpenCL build.header build.levels ninja graphics static linux.ui mac.ui build.xcode beautification code_quality.clang_analysis serialization integration.mpi integration.release_debug integration.tutorials integration performance profile release.source linux.clang.score linux.gcc.score mac.clang.score linux.scripts.pyrosetta scripts.rosetta.parse scripts.rosetta.validate scripts.rosetta.verify linux.clang.unit.release linux.gcc.unit.release

Merge pull request #3712 from RosettaCommons/roccomoretti/deep_copy_util Add a deep copy utility class. Having a member variable with deep-copy semantics makes things more complicated than it should. Having just one member variable that needs special treatment means that you can't use the implicit copy/assignment operators, necessitating manual copying of the 100 other member variables in the class, and all the attendant issues with forgetting one, or having someone add one and forget to copy it over, etc. Instead, it would be nice to have a wrapper class which just "does the right thing". That's what the new utility::pointer::DeepCopyOP class in this PR intends to do. By using a DeepCopyOP class (instead of a straight OP) as a member variable in your class, you should get automatic deep-copy semantics from the implicit copy/assignment operators, but the member variable should work identically to an OP. The only little "wart" on the implementation is that permit use of forward headers, you need to declare (in the forward header) a (non-class) deep_copy() function in the header, and then define it with the appropriate semantics (usually just calling clone() on the object). I've done some test conversions on MainchainScoreTable and AnchoredGraftMover, and things seem to be working. There may be edge cases where the DeepCopyOP is not 100% convertible with a regular OP, but I think it will be possible to extend the DeepCopyOP class for those cases.