Refactor class hierarchy to avoid virtual inheritance #148
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR removes the virtual inheritance support which was originally introduced to support multiple subsystem types:
classDiagram class VQwSubsystem { <<abstract>> +TString fSystemName +ProcessEvent() +operator=(VQwSubsystem*) } class VQwSubsystemParity { <<abstract>> +operator=(VQwSubsystem*) = 0 +operator+=(VQwSubsystem*) = 0 +FillDB() +Blind() } class VQwSubsystemTracking { <<abstract>> +operator=(VQwSubsystem*) = 0 } class VQwDetectorArray { <<abstract>> +vector<QwIntegrationPMT> fIntegrationPMT +vector<QwCombinedPMT> fCombinedPMT +operator=(VQwSubsystem*) +operator+=(VQwSubsystem*) } class QwDetectorArray { +QwDetectorArray(name) +using VQwDetectorArray::operator= } class QwBlindDetectorArray { +Blind(QwBlinder*) +using VQwDetectorArray::operator= } class QwScanner { +QwScanner(name) +operator=(VQwSubsystem*) +operator+=(VQwSubsystem*) +FillDB() +Blind() } %% Virtual inheritance relationships VQwSubsystem <|-- VQwSubsystemParity : "virtual inheritance" VQwSubsystem <|-- VQwSubsystemTracking : "virtual inheritance" VQwSubsystemParity <|-- VQwDetectorArray : "virtual inheritance" %% Regular inheritance VQwDetectorArray <|-- QwDetectorArray : "public inheritance" QwDetectorArray <|-- QwBlindDetectorArray : "public inheritance" %% Show the diamond pattern being avoided VQwSubsystemParity <|-- QwDetectorArray : "virtual public (redundant)" VQwSubsystemParity <|-- QwBlindDetectorArray : "virtual public (redundant)" %% Show the diamond pattern being avoided VQwSubsystemParity <|-- QwScanner : "virtual public (redundant)" VQwSubsystemTracking <|-- QwScanner : "virtual public (redundant)" note for VQwSubsystemParity "Uses virtual inheritance\nto avoid diamond problem" note for QwDetectorArray "Uses 'using' declarations\nto expose base operators" note for VQwSubsystemTracking "Already removed" note for QwScanner "Already removed"Since we don't aim to support VQwSubsystemTracking anymore, we can get rid of the virtual inheritance entirely.