Remove facade methods from TargetCalculator#6838
Merged
totto82 merged 2 commits intoOPM:masterfrom Mar 2, 2026
Merged
Conversation
Contributor
Author
|
jenkins build this serial please |
Contributor
Author
|
Putting this in draft mode until #6837 has been merged |
Remove the groupTarget() forwarding method from both TargetCalculator and InjectionTargetCalculator. Call sites now call GroupStateHelper::getProductionGroupTarget() or getInjectionGroupTarget() directly, making the data flow explicit. With groupTarget() gone, several members become unused: - TargetCalculator: remove group_ (4 → 3 members) - InjectionTargetCalculator: remove group_, resv_coeff_, injection_phase_, cmode_ (7 → 3 members) The InjectionTargetCalculator constructor is simplified from 4 parameters to 2 (groupStateHelper, injection_phase). Pure refactoring — no behavioral change.
Remove the guideTargetMode() method from both TargetCalculator and InjectionTargetCalculator. Call sites in GroupStateHelper.cpp now call the existing getProductionGuideTargetMode() / getInjectionGuideTargetMode() methods on GroupStateHelper directly, eliminating the duplicate switch logic.
f3a274a to
d5d91c2
Compare
Contributor
Author
|
jenkins build this serial please |
Member
|
Thanks for the cleanup. With this, there is not much left in the TargetCalculator. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Builds on #6837 which should be merged first.
Remove
groupTarget()forwarding method from bothTargetCalculatorandInjectionTargetCalculator. Call sites now callGroupStateHelper::getProductionGroupTarget()/getInjectionGroupTarget()directly, making the data flow explicit.Remove
guideTargetMode()from both calculators, replacing the 6 call sites inGroupStateHelper.cppwith the existinggetProductionGuideTargetMode()/getInjectionGuideTargetMode()methods, eliminating duplicate switch logic.InjectionTargetCalculatordrops from 3 to 1 member (pos_).Slim down
TargetCalculatorfrom 4 to 3 members by removinggroup_(only used in the removedgroupTarget()).Slim down
InjectionTargetCalculatorfrom 7 to 1 member by removinggroup_,resv_coeff_,injection_phase_,cmode_,groupStateHelper_, andtarget_. Onlypos_remains.Simplify
InjectionTargetCalculatorconstructor from 4 parameters to 2 (groupStateHelper,injection_phase). ThegroupStateHelperreference is used duringconstruction only (not stored).