mw/com: Fix method signature to avoid copies of return type#369
Draft
mw/com: Fix method signature to avoid copies of return type#369
Conversation
These comments are redundant with the test names and tests themselves. These comments are very likely to become out of date if these tests change / are moved so we remove them.
We store the set and get method dispatches always as unique_ptrs which are either nullptrs in case set / get is disabled or a pointer to a valid binding. This allows us to avoid having constructors for each combination of get / set.
Previously, IsSetHandlerRegistered would return true even if no handler was registered but the setter was not enabled. The new name is semantically clearer in this case.
The getter / setter methods don't register themselves with the parent skeleton, rather the field registers itself. Therefore, the field is also responsible for updating the reference to SkeletonBase in the contained methods.
We pass true for the setter flag to test the creation of the setter method binding in traits_test. Currently, this also creates the getter method binding. In future, this will be enabled via a template parameter.
- Extracts constants into global constant. - Removes EXPECT_CALLS which are not part of the expectations of the test. - Cleans up some given / when / then comments
456b608 to
44e9aa3
Compare
This is the copy variant of set which takes a field value and returns the new value via the MethodReturnTypePtr. The provided value will not be modified so it's misleading that it's non-const.
44e9aa3 to
b336e39
Compare
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.
Depends-on: #373