[Core]: Refactorization of control function address claiming and factory methods #463
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.
Describe your changes
With the goal in mind of getting rid of the singleton from the network manager, I removed a bit of dependencies of the control functions on the network manager. This should be another step closer to making it easy to flip the network manager around.
What changed:
InternalControlFunction::create
->CANNetworkManager::create_internal_control_function
PartneredControlFunction::create
->CANNetworkManager::create_partnered_control_function
AddressClaimStateMachine
class, and instead housed it directly into theInternalControlFunction
class. They already had an 1:1 relation, so it basically was nothing more than an extension at this point.How has this been tested?
Made sure that the unit tests still correctly ran without making functional changes. Only minor thing is the removal of the check that a control function is correctly removed when it's "destroyed". I think that's something to look at later and currently gave more of a headache than it was useful. So I removed that GTEST assert.
Furthermore, I ran the seeder and VT3 object pool examples, they both still work fine. For most of the examples I removed the set preferred address, since according to the standard they have no function specifically defined for the currently configured preferred address: