Skip to content

mw/com: Fix method signature to avoid copies of return type#369

Draft
bemerybmw wants to merge 13 commits intomainfrom
brem_methods_dont_copy_return
Draft

mw/com: Fix method signature to avoid copies of return type#369
bemerybmw wants to merge 13 commits intomainfrom
brem_methods_dont_copy_return

Conversation

@bemerybmw
Copy link
Copy Markdown
Contributor

@bemerybmw bemerybmw commented Apr 28, 2026

Depends-on: #373

@bemerybmw bemerybmw added the invalid This doesn't seem right label Apr 28, 2026
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
@bemerybmw bemerybmw force-pushed the brem_methods_dont_copy_return branch from 456b608 to 44e9aa3 Compare April 30, 2026 15:01
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.
@bemerybmw bemerybmw force-pushed the brem_methods_dont_copy_return branch from 44e9aa3 to b336e39 Compare April 30, 2026 16:10
@bemerybmw bemerybmw changed the title Brem methods dont copy return mw/com: Fix method signature to avoid copies of return type Apr 30, 2026
@bemerybmw bemerybmw removed the invalid This doesn't seem right label Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant