Skip to content

Apply Rule of Zero to core signal event hierarchies#688

Open
lyskov-ai wants to merge 1 commit intoRosettaCommons:mainfrom
lyskov-ai:refactor/core-signal-events-rule-of-zero
Open

Apply Rule of Zero to core signal event hierarchies#688
lyskov-ai wants to merge 1 commit intoRosettaCommons:mainfrom
lyskov-ai:refactor/core-signal-events-rule-of-zero

Conversation

@lyskov-ai
Copy link
Copy Markdown
Contributor

Summary

Each of the simple polymorphic signal-event classes in core/conformation/signals/ and core/pose/signals/ had a hand-written copy constructor, copy assignment, and empty destructor that all just did what the compiler-generated versions would do. Removing the boilerplate brings them in line with the Rule of Zero while preserving the polymorphic base destructors as = default.

Touched:

  • core/conformation/signals/: GeneralEvent, ConnectionEvent, IdentityEvent, XYZEvent
  • core/pose/signals/: GeneralEvent, DestructionEvent, ConformationEvent, EnergyEvent

LengthEvent is intentionally left alone — its copy constructor and copy assignment invoke check_consistency() in debug builds, so they have real semantic content beyond member-wise copy.

Net diff: 8 files changed, 4 insertions(+), 188 deletions(-).

Test plan

  • mode=debug build passes (clean, -Werror)
  • mode=release bin build passes
  • CI green

The signal event classes in core/conformation/signals/ and core/pose/signals/
each had hand-written copy constructor, copy assignment, and empty destructor
that did nothing the compiler-generated versions wouldn't do. Remove the
boilerplate and let the compiler generate the copy operations; keep the
destructor declared (defaulted) where the class is a polymorphic base.

Touched: GeneralEvent, ConnectionEvent, IdentityEvent, XYZEvent (conformation);
GeneralEvent, DestructionEvent, ConformationEvent, EnergyEvent (pose).

LengthEvent is intentionally left alone -- its copy constructor and copy
assignment invoke check_consistency() in debug builds, so they have semantic
content beyond member-wise copy.
@lyskov lyskov requested a review from roccomoretti May 3, 2026 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants