container hierarchy is refactored#171
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the container hierarchy in the HTTP protocol library by consolidating view-based and base classes, simplifying template parameters, and removing outdated container classes.
- Removes separate view classes (
fields_view_base,message_view_base,request_view,response_view) and consolidates functionality into base classes - Changes static containers (
static_request,static_response) from template classes to regular classes that accept external storage - Updates the parser to return static container references instead of view objects
Reviewed Changes
Copilot reviewed 55 out of 55 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
test/unit/test_helpers.hpp |
Updates function parameter from fields_view_base to fields_base |
test/unit/static_response.cpp |
Simplifies tests for new non-template static_response API |
test/unit/static_request.cpp |
Simplifies tests for new non-template static_request API |
test/unit/request_parser.cpp |
Updates to use static_request reference instead of request_view |
test/unit/response.cpp |
Removes response_view usage and adds response_base constructor test |
test/unit/request.cpp |
Removes request_view usage and adds request_base constructor test |
test/unit/fields_base.cpp |
Consolidates iterator and observer functionality from removed view classes |
src/serializer.cpp |
Updates to use message_base instead of message_view_base |
src/parser.cpp |
Changes to return static_request/static_response references instead of views |
include/boost/http_proto/static_response.hpp |
Removes template parameter and updates to use external storage constructor |
include/boost/http_proto/static_request.hpp |
Removes template parameter and updates to use external storage constructor |
include/boost/http_proto/fields_base.hpp |
Consolidates functionality from removed view classes |
| Multiple removed files | Removes obsolete view classes and static fields template |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| fields_base( | ||
| detail::kind k, | ||
| char* storage, | ||
| void* storage, |
There was a problem hiding this comment.
Parameter type changed from char* to void* but the implementation still casts to char*. Consider keeping char* type for clarity since the storage is specifically for character data, or add documentation explaining the void* to char* cast.
| void* storage, | |
| char* storage, |
| // TODO use union | ||
| return reinterpret_cast<static_response const&>(m_); |
There was a problem hiding this comment.
Using reinterpret_cast to convert between static_request and static_response is unsafe and relies on implementation details. The TODO comment indicates this should use a union instead for type safety.
|
An automated preview of the documentation is available at https://171.http-proto.prtest.cppalliance.org/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2025-10-07 10:27:17 UTC |
|
GCOVR code coverage report https://171.http-proto.prtest.cppalliance.org/gcovr/index.html |
dfe3e83 to
4c6d7e0
Compare
|
GCOVR code coverage report https://171.http-proto.prtest.cppalliance.org/gcovr/index.html |
4c6d7e0 to
9ee7f6d
Compare
|
GCOVR code coverage report https://171.http-proto.prtest.cppalliance.org/gcovr/index.html |
9ee7f6d to
59f8aa1
Compare
|
GCOVR code coverage report https://171.http-proto.prtest.cppalliance.org/gcovr/index.html |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #171 +/- ##
===========================================
- Coverage 92.53% 92.48% -0.06%
===========================================
Files 81 71 -10
Lines 5061 4854 -207
===========================================
- Hits 4683 4489 -194
+ Misses 378 365 -13
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
59f8aa1 to
78d0fef
Compare
|
GCOVR code coverage report https://171.http-proto.prtest.cppalliance.org/gcovr/index.html |
78d0fef to
866a68b
Compare
|
GCOVR code coverage report https://171.http-proto.prtest.cppalliance.org/gcovr/index.html |
866a68b to
b927d33
Compare
|
GCOVR code coverage report https://171.http-proto.prtest.cppalliance.org/gcovr/index.html |
b927d33 to
2425c60
Compare
|
GCOVR code coverage report https://171.http-proto.prtest.cppalliance.org/gcovr/index.html |
No description provided.