-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: Remove the ReadClient* parameter to ReadClient::Callbacks #14013
Conversation
PR #14013: Size comparison from f0f5de0 to a21b332 Decreases (9 builds for cyw30739, k32w, p6, qpg, telink)
Full report (10 builds for cyw30739, k32w, p6, qpg, telink)
|
a21b332
to
feb7df8
Compare
PR #14013: Size comparison from e169fcf to feb7df8 Decreases (24 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
Full report (33 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
|
feb7df8
to
2e3f1ea
Compare
2e3f1ea
to
72c9d7e
Compare
PR #14013: Size comparison from 0902641 to 72c9d7e Decreases (23 builds for cyw30739, efr32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
Full report (31 builds for cyw30739, efr32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
|
72c9d7e
to
4af2028
Compare
PR #14013: Size comparison from 2e0f64d to 4af2028 Decreases (18 builds for cyw30739, efr32, esp32, k32w, linux, mbed, p6, qpg, telink)
Full report (22 builds for cyw30739, efr32, esp32, k32w, linux, mbed, p6, qpg, telink)
|
fast track: generally a refector except the deletion bits which was approved by a domain owner. PR has been up sufficient time for cross timezone review. |
c4ecfb6
to
ee34073
Compare
Currently each ReadClient callback takes as a parameter a pointer to the ReadClient itself. This is not very useful and introduces undesirable coupling: It prevents creating another class (say, MockReadClient or NextGenReadClient) that is compatible with existing callbacks without the same concrete implementation class. This is showing up very concretely in tests that are passing "nullptr" since their test double cannot be passed through the callback.
ee34073
to
c7aa9a1
Compare
PR #14013: Size comparison from 5429dca to c7aa9a1 Decreases (15 builds for cyw30739, efr32, esp32, k32w, linux, p6, qpg, telink)
Full report (17 builds for cyw30739, efr32, esp32, k32w, linux, p6, qpg, telink)
|
@mspang Why did you revert the mbed-os-posix-socket version here? |
…ct-chip#14013) Currently each ReadClient callback takes as a parameter a pointer to the ReadClient itself. This is not very useful and introduces undesirable coupling: It prevents creating another class (say, MockReadClient or NextGenReadClient) that is compatible with existing callbacks without the same concrete implementation class. This is showing up very concretely in tests that are passing "nullptr" since their test double cannot be passed through the callback.
I would guess accidental due to bad merge.... |
The changes in project-chip#14013 probably did not mean to roll back the submodule update from project-chip#12616.
I created #14613 to fix that. |
Problem
Currently each ReadClient callback takes as a parameter a pointer to the
ReadClient itself. This is not very useful and introduces undesirable
coupling: It prevents creating another class (say, MockReadClient or
NextGenReadClient) that is compatible with existing callbacks
without the same concrete implementation class.
This is showing up very concretely in tests that are passing "nullptr"
since their test double cannot be passed through the callback.
Change overview
Remove the ReadClient pointer from each callback. There are few
uses of this, and none are crucial, as the creator of the read client
already has as pointer to it.
The only nontrivial use of of this is freeing read clients in OnDone,
which is quite subtle and problematic because shutting down
with pending IM callbacks will leak the client. In any case, we
can preserve the semantics by simply adopting the client
into the callback.
Testing
Unit tests.